diff options
author | mh <mh@immerda.ch> | 2011-08-05 10:57:13 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-08-05 10:57:13 +0200 |
commit | e99f7c8672342c4e00522e6be851a14ae1d56d4d (patch) | |
tree | affef1eb14be7bba24ec5a243e34e40e16f8b892 /manifests | |
parent | 85a8fedbd80c026e933b8204a607f72dff2ddad1 (diff) |
migrate concatenated_file to the concat module
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/preferences.pp | 16 | ||||
-rw-r--r-- | manifests/preferences_snippet.pp | 10 |
2 files changed, 10 insertions, 16 deletions
diff --git a/manifests/preferences.pp b/manifests/preferences.pp index 71ef0a6..f188149 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -1,9 +1,6 @@ class apt::preferences { - include common::moduledir - $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences" - module_dir{'apt/preferences': } - file { "${apt_preferences_dir}_header": + concat::fragment{"apt_preferences_header": content => $custom_preferences ? { '' => $operatingsystem ? { 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"), @@ -11,16 +8,15 @@ class apt::preferences { }, default => $custom_preferences }, + order => 00, + target => '/etc/apt/preferences', } - concatenated_file { '/etc/apt/preferences': - dir => $apt_preferences_dir, - header => "${apt_preferences_dir}_header", - # use Concatenated_file[apt_config] to reference a completed configuration - # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML + concat{'/etc/apt/preferences': alias => apt_config, # only update together - require => File["/etc/apt/sources.list"]; + 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 4b8e575..bcc12de 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -11,11 +11,9 @@ define apt::preferences_snippet( include apt::preferences - file { "${apt::preferences::apt_preferences_dir}/${name}": + concat::fragment{"apt_preference_${name}": ensure => $ensure, - #TODO this template is somewhat limited - notify => Exec["concat_${apt::preferences::apt_preferences_dir}"], - owner => root, group => 0, mode => 0600; + target => '/etc/apt/preferences', } # This should really work in the same manner as sources_list and apt_conf @@ -23,12 +21,12 @@ define apt::preferences_snippet( # lenny, we can't generalize without going into ugly special-casing. case $source { '': { - File["${apt::preferences::apt_preferences_dir}/${name}"] { + Concat::Fragment[$name]{ content => template("apt/preferences_snippet.erb") } } default: { - File["${apt::preferences::apt_preferences_dir}/${name}"] { + Concat::Fragment[$name]{ source => $source } } |