Using Puppet to install software "bundles"
We're in the process of researching a configuration/systems management implementation and we've done quite a lot of demoing of Puppet. Puppet seems to excel at the somewhat simple "ensure this package is installed, this config file exists, and that this service is running."
I can't seem to find a good real world example of managing software that doesn't play so nicely. Some examples:
- IBM DB2 (distributed via tarball with installer, "fixpacks" are similiar)
- Simpana CommVault (uses an installer with an ncurses interface, but will accept an "answer" file if coaxed)
- AccuRev (binary installer, with "answer" file support)
- VMWare Tools (binary installer)
What approach have Puppet users taken to integrate software like this into their environments?
Solution 1:
I maintain a server with locally created files, and make .deb or .rpm packages for such softwares myself.
In a few cases where I haven't bothered to do anything about it, I do an exec wget
to download the file, and an exec
with the extraction method, whatever it may be, with the creates
attribute pointing to the main binary. It won't handle updates, however.
To handle update, make the installation exec
a refreshonly => true
, and put a notify
on the exec
for wget
.
Sample:
exec { "/usr/bin/wget http://fileserver.domain/jboss/jboss-${version}.prd.tar.gz -O /tmp/jboss.tgz":
creates => '/tmp/jboss.tgz',
require => Package['wget'],
alias => 'wget_jboss',
}
exec { '/bin/tar xzvf /tmp/jboss.tgz':
cwd => '/opt',
creates => "/opt/jboss-${version}/bin",
user => 'jboss',
group => 'jboss',
require => [ User['jboss'], Exec['wget_jboss'], File["/opt/jboss-${version}"], ],
before => Service['jboss'],
alias => 'untar_jboss',
}
Solution 2:
The exec
resource is kinda the catch-all for managing anything that doesn't fit nicely into one of the other package types.
If you can get something to go unattended on the command line, and you can check for a file's existence to confirm the installation, then you should be able to get puppet to handle it.
One of your examples, VMware Tools, has a module on the puppet module forge site, here. As you can see from the init.pp file (here), the install process is done mainly via exec
resources.