Showing posts with label puppet. Show all posts
Showing posts with label puppet. Show all posts

Friday, January 18, 2008

facter -- where to find puppet variables

I'm really loving puppet. I was able to build an application server from scratch in about 20 minutes. 19 of them were watching progress bars and syslog output. I can magically reconfigure the systems as I go and any work on do for one system can be applied to all of them.

I was hunting around for what variables are available when writing puppet configuration. I found a page that points out puppet uses something called 'facter'. I think facter is packaged with puppet. It's on my systems anyway.

If you call 'facter' you get some nice output about your system. All of those variables are available in your puppet configs.

Wednesday, January 16, 2008

Puppet just made me about 3000% more efficient

I've spent the afternoon playing with puppet. It's brilliant and I wish I would have set it up sooner.


My test setup does the following:
  • creates a file called /tmp/hello_world
  • makes sure that screen and vim-enhanced
  • makes sure ntp is installed, running and configured to start (using the default config)
  • makes sure the perforce cli is installed
  • make sure snmp is configured the way I like it
  • /etc/resolv.conf is configured as I expect it
I can create classes that map to my different server rolls. I can make sure key configuration files are up to date -- if I had to change nameservers in /etc/resolv.conf due to IP changes, I'd have to log into every one of my boxes and manually change it. With puppet, it's a variable change and all my systems update.

The following configures your snmp server for you. Stick the following into a pp file:

define snmp_server($community = "public",
$location = "Unknown (edit /etc/snmp/snmpd.conf)",
$contact = "Root (configure /etc/snmp/snmp.local.conf)"
) {

file { "/etc/snmp/snmpd.conf":
ensure => present,
mode => "0644",
owner => "root",
group => "root",
content => template("snmpd.conf.erb"),
}

include snmp_apps
}

class snmp_apps {
package { net-snmp: ensure => installed, }
package { net-snmp-devel: ensure => installed, }
package { net-snmp-utils: ensure => installed, }

service { snmpd:
ensure => true,
enable => true,
subscribe => File["/etc/snmp/snmpd.conf"]
}
}

And this into a snmpd.conf.erb template file in your template directory:

com2sec notConfigUser default
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1 <%= community %>
access notConfigGroup "" any noauth exact systemview none none
syslocation <%= location %>
syscontact <%= contact %>

Then configure your systems with:

snmp_server { "not used" : community => 'your_commnity', location => 'Springfield', contact => 'root@apple.com' }

Keep in mind that my configs are for Redhat/CentOS systems only -- but you could easily make these cross-unix compatible.

Sunday, January 13, 2008

So this is it

Friday was my last day at the old job. It was a very bitter-sweet day. Eight years, two months is a long time to be anywhere in the IT world, especially since it has been my only real day job.


The weirdest part was handing in my key, swipe card and garage door clicker. My keychain is very light now. 

I've been working in that space for 5 years. Where will I park down town? Will I ever see my servers again? What do I do with my guitar?

The IT team gave me a touching card and $100 give certificate. I'm going to miss working with those guys the most. Solving problems with them always gave me endorphin rushes. It will be strange not having a dozen other people within 30 feet to discuss ideas with.

We headed to a pub after work. I was surprised when 25-30 people showed up. A bunch of ex-employees from throughout the ages came out. 

I officially start the new gig Monday. I'll have a few infrastructure things to work on (email, backups, etc). That will be easier than doing it at the old gig, considering there is only a handful of people to deal with it. Then, I think I'm going to be working on build automation and architecture design. 

My plan is to experiment with Puppet and cfengine. I've been making complex kickstart files for a long time. The problem with those is that you only get one shot -- if you change your NTP servers, add an SNMP community or any other global config change you need to log into every system and update them. From what I understand, using puppet or cfengine, this is all automated for you.

It's going to be cool..