Package Install Options in Puppet

One of the new features released in Puppet 3.4.0 is the ability to add options to rpm package installs. This is a feature that’s been discussed in a couple of tickets over the years and now we’ve got an official, in core, approach I’ve copied the code to the yum and apt providers github branch.

  class pkgoptions {

    package { 'strace':
      ensure          => 'installed',
      provider        => 'yum',
      install_options => [ '--noplugins', '--enablerepo=fedora' ],
      # or install_options => [ '-t', 'squeeze-backports' ], for Debian backports
    }

  }

The approach in this patch is not the final one I’d like to take so I’ve not submitted it upstream. It should be possible to extract some of the duplication between the providers up in to a util class. Of course they also need spec tests but as a replacement for some of the exec based workarounds I’ve seen, in yum to enable specific repos and in Debian for back-ported packages, this is much closer to where I’d want my manifests to be.