You want to install a package but need custom options.
class yum_package_options {
# enable a repo while installing 'localpkg'
package { 'localpkg':
install_options => ['--enablerepo', 'company_repo'],
}
# turn off all plugins and install the package
# using only the local cache
package { 'localapppkg':
install_options => ['--noplugins', '--cacheonly' ],
}
}
class apt_package_options {
# install a package from backports using Apt
package { 'backported-local-pkg':
install_options => ['-t', 'jessie-backports'],
}
}
When installing packages there are times you need to customise the options passed to your package manager. Some basic examples are:
In the past these use cases required you to install a package via
an explicit exec
but in modern Puppet they are supported by the
install_options
attribute offered by a number of package
providers.