* Expose the underlying notify_update setting of the apt::settings resource
This is because not all configuration file changes should trigger an apt::update notification
* apt::pin also shouldn't result in an apt-update call
Adding a pin configuration should apply to the next apt-get update call it shouldn't trigger one itself.
* Added documentation
* Add tests for apt::conf notify_update
* `priority`: *Optional.* Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first. Valid options: a string containing an integer. Default: '50'.
* `priority`: *Optional.* Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first. Valid options: a string containing an integer. Default: '50'.
+* `notify_update`: *Optional.* Specifies whether to trigger an `apt-get update` run. Valid options: 'true' and 'false'. Default: 'true'.
+
#### Define: `apt::key`
Manages the GPG keys that Apt uses to authenticate packages.
#### Define: `apt::key`
Manages the GPG keys that Apt uses to authenticate packages.
+Manages Apt pins. Does not trigger an `apt-get update` run.
**Note:** For context on these parameters, we recommend reading the man page ['apt_preferences(5)'](http://linux.die.net/man/5/apt_preferences)
**Note:** For context on these parameters, we recommend reading the man page ['apt_preferences(5)'](http://linux.die.net/man/5/apt_preferences)
- $content = undef,
- $ensure = present,
- $priority = '50',
+ $content = undef,
+ $ensure = present,
+ $priority = '50',
+ $notify_update = undef,
) {
unless $ensure == 'absent' {
) {
unless $ensure == 'absent' {
}
apt::setting { "conf-${name}":
}
apt::setting { "conf-${name}":
- ensure => $ensure,
- priority => $priority,
- content => template('apt/_conf_header.erb', 'apt/conf.erb'),
+ ensure => $ensure,
+ priority => $priority,
+ content => template('apt/_conf_header.erb', 'apt/conf.erb'),
+ notify_update => $notify_update,
$file_name = regsubst($title, '[^0-9a-z\-_\.]', '_', 'IG')
apt::setting { "pref-${file_name}":
$file_name = regsubst($title, '[^0-9a-z\-_\.]', '_', 'IG')
apt::setting { "pref-${file_name}":
- ensure => $ensure,
- priority => $order,
- content => template('apt/_header.erb', 'apt/pin.pref.erb'),
+ ensure => $ensure,
+ priority => $order,
+ content => template('apt/_header.erb', 'apt/pin.pref.erb'),
+ notify_update => false,
end
describe "when creating an apt preference" do
end
describe "when creating an apt preference" do
{
:priority => '00',
:content => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n"
}
end
{
:priority => '00',
:content => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n"
}
end
+ let :params do
+ default_params
+ end
let :filename do
"/etc/apt/apt.conf.d/00norecommends"
let :filename do
"/etc/apt/apt.conf.d/00norecommends"
+
+ context "with notify_update = true (default)" do
+ let :params do
+ default_params
+ end
+ it { is_expected.to contain_apt__setting("conf-#{title}").with_notify_update(true) }
+ end
+
+ context "with notify_update = false" do
+ let :params do
+ default_params.merge({
+ :notify_update => false
+ })
+ end
+ it { is_expected.to contain_apt__setting("conf-#{title}").with_notify_update(false) }
+ end
end
describe "when creating a preference without content" do
end
describe "when creating a preference without content" do