diff options
author | mh <mh@immerda.ch> | 2011-08-05 10:57:13 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2012-04-11 11:35:31 +0200 |
commit | 8996d83489159ec34187a18d18bc0d7566f2cbe5 (patch) | |
tree | fc13dd2e80892e2a6d54aca0294899fb28480580 | |
parent | a835369958226bac2d010fedb50ed5ef98b5906f (diff) |
migrate concatenated_file to the concat module
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | manifests/preferences.pp | 16 | ||||
-rw-r--r-- | manifests/preferences_snippet.pp | 10 |
3 files changed, 11 insertions, 16 deletions
@@ -19,6 +19,7 @@ This module needs: - lsb-release installed - the common module: git://labs.riseup.net/shared-common +- the concat module: https://github.com/ripienaar/puppet-concat By default, on normal hosts, this module sets the configuration option DSelect::Clean to 'auto'. On virtual servers, the value is set by default to 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 } } |