Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Move Package['python-software-properties'] to apt:ppa
[puppet-modules/puppetlabs-apt.git]
/
manifests
/
init.pp
diff --git
a/manifests/init.pp
b/manifests/init.pp
index 068fb497c4933d3e9d7fb6af925c0a0ab459a581..e41cd3fdee7514b6373603d917638e3a77dbd28e 100644
(file)
--- a/
manifests/init.pp
+++ b/
manifests/init.pp
@@
-29,23
+29,21
@@
class apt(
) {
include apt::params
) {
include apt::params
+ include apt::update
validate_bool($purge_sources_list, $purge_sources_list_d)
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 ? {
$sources_list_content = $purge_sources_list ? {
- false =>
undef,
+ false => undef,
true => "# Repos managed by puppet.\n",
}
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
$root = $apt::params::root
$apt_conf_d = $apt::params::apt_conf_d
$sources_list_d = $apt::params::sources_list_d
@@
-58,6
+56,7
@@
class apt(
group => root,
mode => '0644',
content => $sources_list_content,
group => root,
mode => '0644',
content => $sources_list_content,
+ notify => Exec['apt_update'],
}
file { 'sources.list.d':
}
file { 'sources.list.d':
@@
-67,12
+66,7
@@
class apt(
group => root,
purge => $purge_sources_list_d,
recurse => $purge_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 {
}
case $disable_keys {
@@
-89,7
+83,7
@@
class apt(
path => "${apt_conf_d}/99unauth",
}
}
path => "${apt_conf_d}/99unauth",
}
}
- undef: { } # do nothing
+ undef:
{ } # do nothing
default: { fail('Valid values for disable_keys are true or false') }
}
default: { fail('Valid values for disable_keys are true or false') }
}