Search This Blog

Friday, February 26, 2016

Building TheForeman Smart-Proxy from git source on SLES 11sp3

So for months I've been battering my head at the day job trying to integrate puppet in a meaningful fashion.  I wanted The Foreman; a nifty front end manager for both salt AND puppet which allows lifecycle management with relative ease.

Relative is key here, NOTHING is simple in the world of devops.

So I ran into an issue; our puppet-master installation is on a SLES 11.3 box.  Despite getting a CENTOS 6.5 vm setup for theforeman, I needed to somehow run my existing master through a separate Foreman front end.

This is where smart proxies come in.  In a normal, sane, non SLES system, you'd just do something stupid like "apt-get install foreman-proxy" or something like that. Not SLES, nope.

Instead you have to install git:
zypper addrepo http://download.opensuse.org/repositories/devel:/tools:/scm/SLE_11_SP3/devel:tools:scm.repo

zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/perl/SLE_11_SP3/devel:languages:perl.repo

zypper refresh

zypper install git-core

Then you have to prep and clone the source:
     mkdir /var/share/foreman-proxy
    git clone git://github.com/theforeman/smart-proxy.git /var/share/foreman-proxy
    useradd -r foreman-proxy
    mkdir /var/log/foreman-proxy
    mkdir /usr/share/foreman-proxy/ssl
    mkdir /usr/share/foreman-proxy/ssl/certs
    mkdir /usr/share/foreman-proxy/ssl/private_keys
    cd /usr/share/foreman-proxy
    chown -R foreman-proxy:root /usr/share/foreman-proxy/ssl
    chown -R foreman-proxy:foreman-proxy /var/log/foreman-proxy
    there's more, but I'm not 100% on the process so I'll just give you my reference: http://projects.theforeman.org/projects/foreman/wiki/_passenger_on_Puppet_PE_and_use_foreman_as_an_ENC_and_reporting_engine_
Then you have to build/install the source:
cd /usr/share/foreman-proxy
gem build smart_proxy.gemspec
gem install smart_proxy-1.12.0.develop.gem     #note, your ver may vary depending on build's output!
It goes and acts completed but still won't run.
 So that didn't work..

gem install bundler
zypper install ruby1.8-rubygem-ruby-augeas             #requires dev libs/opensuse etc.
cd /usr/share/foreman-proxy bundle install
cd /usr/share/foreman-proxy/bin
./smart-proxy

And I get an error.
There's also a /usr/bin/smart-proxy that gives a different error.
Regardless, this is where we are!


This is as far as I've gotten and given the limited nature of queries on the internet which actually had answers, hopefully this will help some other poor bastard stuck on SLES with a similar issue.

*** addendum 10:45am ***
Turns out after you install smart proxy via bundler, you have to do this:
cd /usr/share/foreman-proxy
bundle exec bin/smart-proxy

At which time you'll discover you need to have a valid settings.yml  file.
That is located in config/settings.yml.example.  So cp that file to config/settings.yml and modify it as needed.  Then rerun bundle exec bin/smart-proxy  and you should have something akin to success!

Tuesday, February 23, 2016

Having a kid is hard work.

I'm really desperately trying to take the time necessary to properly review a few products but it's time consuming having a kid and trying to make the time to have another the way you want (VBAC, etc).  So my wife and I have our hands full.  Hopefully I can put some time aside this week to do things.

Monday, February 15, 2016

I've been kind of slacking.

Blogs do this thing where it's like... doing your dishes after a while.  It becomes a bit of a chore and if you have too many other chores in real life to do - it falls off the radar.
That's exactly what happened here.

NONE of my projects got worked last week.  I'm a bit ashamed of that, because I did at some points have time - just no energy.  February tends to do that to me, unfortunately; as does the cold.  It's an excuse, I know, but it is what it is.

Work's been tough lately; lots to pick up and learn lately.  Lots to do.  Too many outstanding projects.

Today's been a fruitful day.  I have a puppet master server running on SLES 11 SP3; it's been running for quite some time.  It precedes my tenure at this company, in truth.  So that said, it was never even remotely utilized.  So I've been slowly expanding my functionality to it.  A few little things I've discovered about puppet and SLES:

1) Zypper is not supported, like at all.  However, there are some AWESOME custom repos out there.
2) This is a command you should run pretty much immediately:
    # zypper ar --refresh http://download.opensuse.org/repositories/systemsmanagement:puppet/SLE_11_SP3 opensuse_puppet_repo
    # Hint, this will give you awesome custom SLES based repos of common puppet items, like terminus and PuppetDB.
3) Put this in your crontab, if you don't want to get your disk filled up (assuming you're using a low footprint server like we are).
    # Crontab Puppet cleanup here:
    0 3 * * 5 find /var/lib/puppet/reports/ -type f -ctime +7 | xargs -P 4 -n 20 rm -f | mail -s "Puppet Report Logs Cleaned up!" your.email@company.com
    # Yes, that will mail you a report when this is done weekly.  Verify your puppet reports folder first.
4) I'm working on a simple 'puppet master control' script.  It's going to have:

Basic functions
    1) get the current status  (service XYZ status)
    2) list current nodes (with |more)
    3) restart puppet agent
       - show status post restart
    4) restart puppetmaster
       - check if it's running via ps
    5) tail last 25 lines of puppetmaster log
    6) repair files
    7) clear the reports folder  #see cron above
    8) redo ownership:
        sudo chown -R puppet:puppet `sudo puppet config print confdir`

Good times.
This isn't for me, but rather for my co-workers, who have no idea how puppet works.
This will form a simple framework I can expand to make into a fully featured shellscript that will handle the most simplistic tasks.

But Mike, why not use theforeman?

I would, but the damn thing is a total bastard to install on SLES!

But Mike, what about SALT?

It's still in the mix, but unfortunately also hard to deploy on a mass level due to python being horrendously out of date on SLES 

Upcoming tasks this week:

So at this point I've got a few outstanding things I need to do.  I need to write more stuff for this blog, more reviews (oldpman's scifi kit, for instance), need to add a few thousand words to my "Monsters in the Cold" story, and need to work on getting feedback from a few of my proofers for Neo Monagasque Book 2.  Good news everyone!  Major plot development means no more boring nonsense.   Bad news everyone!  Someone DIES.

I should also work on my game project this week but seriously, when will I have the time?
I'm considering overhauling it or starting from scratch due to new assets being inbound.
It still works as a good learner level but at this point I have better assets to work from.

Stay tuned :)

Monday, February 1, 2016

Monday Status Update 2/1/16

Another monday, another project.
I keep getting more added to my plate at work here without getting much taken off.  I find myself accidentally 'volunteering' for more stuff.

Anyways...

Non work related, my wife bought a very expensive 'print-making' printer for her paintings.  If you're interested, check out her poll over here: http://mariemessina.blogspot.com/2016/02/paintings-for-prints-poll.html

Current status:
  • Books - I began work again on 'MITC' - which is something I don't talk about much.  It's designed to be a short story for a collection I will do.  I'm up to 10k words on that one.
  • Game stuff - Made a free HD sky for game-guru owners here:  https://forum.game-guru.com/thread/214534
  • Tyr's Blade (My mechwarrior unit) is growing slowly and steadily.  Things going well there - newbies are getting better!
  • Game design - I bought the Sci-Fi pack from TGC; I'm satisfied with it but need to figure out what I want to make with it in terms of my existing project.
  • MWDA - did some work on my custom re-work of the game rules.  I have some new ideas I am going to run through and possibly integrate shortly.  Thinking of taking my work into offshoot territory.
Coming up this week:
A review of OldFlak's work!
A technique post on 'how to do interior shadows' in game-guru!
And more :)