) {
include apt::params
+ include apt::update
validate_bool($purge_sources_list, $purge_sources_list_d)
- $refresh_only_apt_update = $always_apt_update? {
- true => false,
- false => true,
- }
-
- if ! defined(Package['python-software-properties']) {
- package { 'python-software-properties': }
- }
-
$sources_list_content = $purge_sources_list ? {
false => undef,
true => "# Repos managed by puppet.\n",
}
+ if $always_apt_update == true {
+ Exec <| title=='apt_update' |> {
+ refreshonly => false,
+ }
+ }
+
$root = $apt::params::root
$apt_conf_d = $apt::params::apt_conf_d
$sources_list_d = $apt::params::sources_list_d
group => root,
mode => '0644',
content => $sources_list_content,
+ notify => Exec['apt_update'],
}
file { 'sources.list.d':
group => root,
purge => $purge_sources_list_d,
recurse => $purge_sources_list_d,
- }
-
- exec { 'apt_update':
- command => "${provider} update",
- subscribe => [ File['sources.list'], File['sources.list.d'] ],
- refreshonly => $refresh_only_apt_update,
+ notify => Exec['apt_update'],
}
case $disable_keys {
path => "${apt_conf_d}/99unauth",
}
}
- undef: { } # do nothing
+ undef: { } # do nothing
default: { fail('Valid values for disable_keys are true or false') }
}