diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/preferences.pp | 20 | ||||
-rw-r--r-- | manifests/preferences_snippet.pp | 12 |
3 files changed, 15 insertions, 23 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 9ce7330..3caa376 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -138,10 +138,6 @@ class apt { # backports uses the normal archive key now package { "debian-backports-keyring": ensure => absent } - include common::moduledir - $apt_base_dir = "${common::moduledir::module_dir_path}/apt" - modules_dir { apt: } - if $custom_key_dir { file { "${apt_base_dir}/keys.d": source => "$custom_key_dir", @@ -155,7 +151,7 @@ class apt { } if $custom_preferences != false { Exec["custom_keys"] { - before => Concat[apt_config], + before => File['apt_config'], } } } diff --git a/manifests/preferences.pp b/manifests/preferences.pp index f188149..f766819 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -1,20 +1,18 @@ class apt::preferences { - concat::fragment{"apt_preferences_header": - content => $custom_preferences ? { - '' => $operatingsystem ? { - 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"), - 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"), - }, - default => $custom_preferences + $pref_contents = $custom_preferences ? { + '' => $operatingsystem ? { + 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"), + 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"), }, - order => 00, - target => '/etc/apt/preferences', + default => $custom_preferences } - concat{'/etc/apt/preferences': - alias => apt_config, + file { '/etc/apt/preferences': + ensure => present, + alias => 'apt_config', # only update together + content => $pref_contents, require => File["/etc/apt/sources.list"], owner => root, group => 0, mode => 0644; } diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 6a8e6bc..1aafe57 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -23,11 +23,9 @@ define apt::preferences_snippet( fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both") } - include apt::preferences - - concat::fragment{"apt_preference_${name}": + file { "/etc/apt/preferences.d/${name}": ensure => $ensure, - target => '/etc/apt/preferences', + owner => root, group => 0, mode => 0644; } # This should really work in the same manner as sources_list and apt_conf @@ -37,19 +35,19 @@ define apt::preferences_snippet( '': { case $release { '': { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ content => template("apt/preferences_snippet.erb") } } default: { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ content => template("apt/preferences_snippet_release.erb") } } } } default: { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ source => $source } } |