2

I'm learning Puppet by example and writing some modules to manage our current RHEL and Ubuntu servers. My first serious attempt is a Zend Server module.

Since Puppet has a Yumrepo, but no Aptrepo resource how would you structure a module to add the repo and install the packages in a distro independent way? People who use the module shouldn't have to care which distro the server runs.

Another thing. I'd like to have Puppet set the ZS admin password after installation, but can't find where it's set. Any idea?

Martijn Heemels
  • 7,438
  • 6
  • 39
  • 62

2 Answers2

2

Something like:

class usefulclass {
    if $operatingsystem == "RHEL" {
        repo { ...
            before => Package["zend"] }
    } else {
        file { "sources.list"... //or however you choose to manage sources.list
            before => Package["zend"] }
    }
}

Don't have a RHEL box handy, but just run facter operatingsystem to find out what the return value to look for is.

BMDan
  • 7,129
  • 2
  • 22
  • 34
  • So you'd suggest handling the operatingsystem switch in the modules instead of the manifests? Sounds like a good idea since it would make the modules more plug-and-play. – Martijn Heemels Sep 01 '10 at 11:58
  • Indeed, that's how we do it. – BMDan Sep 22 '10 at 23:59
  • 1
    Thanks for this! I'm still wet behind the ears w/r/t Puppet, and trying to Puppetize libpam-google-authenticator for both our CentOS and Ubuntu servers. I was going to try to define the `yumrepo{}` blocks and set a `$require` array to require them in the CentOS/RHEL conditional, and set `$require = []` in the Debian/Ubuntu conditional, but this feels much more graceful! – Doktor J Jul 19 '16 at 14:29
1

I'm only beginning to checkout Puppet myself, but I did look at the file: /usr/local/zend/bin/gui_passwd.sh which changes that password (it's there in case you forget the original password).

At the bottom of the script, it puts the MD5'd password into the file: /usr/local/zend/gui/application/data/zend-server-user.ini, though it has to edit the file, with 'sed'.

Alister Bulman
  • 1,624
  • 13
  • 13