Exposing notify_update to apt::source
This commit is contained in:
parent
1e45278668
commit
91092bdc80
3 changed files with 59 additions and 2 deletions
|
@ -485,6 +485,8 @@ Manages the Apt sources in `/etc/apt/sources.list.d/`.
|
||||||
|
|
||||||
* `trusted_source`: Specifies whether to authenticate packages from this release, even if the Release file is not signed or the signature can't be checked. Valid options: 'true' and 'false'. Default: undef. This parameter is **deprecated** and will be removed in a future version of the module.
|
* `trusted_source`: Specifies whether to authenticate packages from this release, even if the Release file is not signed or the signature can't be checked. Valid options: 'true' and 'false'. Default: undef. This parameter is **deprecated** and will be removed in a future version of the module.
|
||||||
|
|
||||||
|
* `notify_update`: *Optional.* Specifies whether to trigger an `apt-get update` run. Valid options: 'true' and 'false'. Default: 'true'.
|
||||||
|
|
||||||
#### Type: `apt_key`
|
#### Type: `apt_key`
|
||||||
|
|
||||||
Manages the GPG keys that Apt uses to authenticate packages.
|
Manages the GPG keys that Apt uses to authenticate packages.
|
||||||
|
|
|
@ -18,6 +18,7 @@ define apt::source(
|
||||||
$key_content = undef,
|
$key_content = undef,
|
||||||
$key_source = undef,
|
$key_source = undef,
|
||||||
$trusted_source = undef,
|
$trusted_source = undef,
|
||||||
|
$notify_update = undef,
|
||||||
) {
|
) {
|
||||||
validate_string($architecture, $comment, $location, $repos)
|
validate_string($architecture, $comment, $location, $repos)
|
||||||
validate_bool($allow_unsigned)
|
validate_bool($allow_unsigned)
|
||||||
|
@ -114,8 +115,9 @@ define apt::source(
|
||||||
}
|
}
|
||||||
|
|
||||||
apt::setting { "list-${name}":
|
apt::setting { "list-${name}":
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
content => template('apt/_header.erb', 'apt/source.list.erb'),
|
content => template('apt/_header.erb', 'apt/source.list.erb'),
|
||||||
|
notify_update => $notify_update,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $pin {
|
if $pin {
|
||||||
|
|
|
@ -387,5 +387,58 @@ describe 'apt::source' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with notify_update = undef (default)" do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'wheezy',
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:puppetversion => Puppet.version,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:location => 'hello.there',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(true) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with notify_update = true" do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'wheezy',
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:puppetversion => Puppet.version,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:location => 'hello.there',
|
||||||
|
:notify_update => true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(true) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with notify_update = false" do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'wheezy',
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:puppetversion => Puppet.version,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:location => 'hello.there',
|
||||||
|
:notify_update => false,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(false) }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue