Ask Your Question
2

Refactoring modules for additional OS support?

asked 2013-03-29 07:51:45 -0500

josh gravatar image

Up until now our modules have only supported Linux (specifically the RedHat family). With the most v2.8 of PE supporting AIX, we want to start using Puppet to manage parts of our AIX infrastructure.

Since there aren't very many common pieces of configuration between AIX and Linux, I'm wondering what the best way to reorganize my modules would be. We currently have three environments - prod, qa, dev.

For our "base" modules, should I just rewrite them and wrap their logic in "case" statements to handle the different operating systems?

How have others handled adding multiple operating system ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-03-30 18:29:06 -0500

nvpuppet gravatar image

updated 2013-03-30 18:33:12 -0500

Please not that the following code has been neither tested nor run through 'parser validate'!

Here's some very simple example code for managing an NTP server that shows a common "params" pattern. You'll see this pattern all over the Forge:

class ntp(
   $ntp_servers = 'pool.ntp.org'
) {
  include ntp::params 

  package { $ntp::params::package: ensure => present, }

  file { $ntp::params::config:
    ensure => file,
    owner => 'root',
    group => 'root',
    mode => '0644',
    content => template('ntp/ntp.conf.erb'),
    require => Package[$ntp::params::package],
  }

  service { $ntp::params::service: 
    ensure => running, 
    enable => true,
    subscribe => File[$ntp:params::config],
  }
}

The ntp::params class is used to ... (more)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-29 07:51:45 -0500

Seen: 193 times

Last updated: Mar 30 '13