diff options
author | Thomas Backlund <tmb@mageia.org> | 2015-10-19 20:35:31 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2015-10-19 20:35:31 +0300 |
commit | 7648fb7e95037a7bd1ef0fd4236cfe122fa1e444 (patch) | |
tree | ba79dc9f64fe108a077508690074e96d52505d30 /external | |
parent | d139941bf8abaf27f7ad307e985672a37301239b (diff) | |
download | puppet-7648fb7e95037a7bd1ef0fd4236cfe122fa1e444.tar puppet-7648fb7e95037a7bd1ef0fd4236cfe122fa1e444.tar.gz puppet-7648fb7e95037a7bd1ef0fd4236cfe122fa1e444.tar.bz2 puppet-7648fb7e95037a7bd1ef0fd4236cfe122fa1e444.tar.xz puppet-7648fb7e95037a7bd1ef0fd4236cfe122fa1e444.zip |
lint fixes for concat
Diffstat (limited to 'external')
-rw-r--r-- | external/concat/manifests/fragment.pp | 6 | ||||
-rw-r--r-- | external/concat/manifests/init.pp | 36 | ||||
-rw-r--r-- | external/concat/manifests/setup.pp | 12 |
3 files changed, 27 insertions, 27 deletions
diff --git a/external/concat/manifests/fragment.pp b/external/concat/manifests/fragment.pp index 890d43a4..ba546766 100644 --- a/external/concat/manifests/fragment.pp +++ b/external/concat/manifests/fragment.pp @@ -1,5 +1,5 @@ # Puts a file fragment into a directory previous setup using concat -# +# # OPTIONS: # - target The file that these fragments belong to # - content If present puts the content into the file @@ -31,17 +31,17 @@ define concat::fragment($target, $content='', $source='', $order=10, $ensure = " } } } - default: { File{ source => $source } } + default: { File{ source => $source } } } } default: { File{ content => $content } } } file{"${fragdir}/fragments/${order}_${safe_name}": + ensure => $ensure, mode => $mode, owner => $owner, group => $group, - ensure => $ensure, backup => $backup, alias => "concat_fragment_${name}", notify => Exec["concat_${target}"] diff --git a/external/concat/manifests/init.pp b/external/concat/manifests/init.pp index b94411c2..e7b2f4b1 100644 --- a/external/concat/manifests/init.pp +++ b/external/concat/manifests/init.pp @@ -1,13 +1,13 @@ # A system to construct files using fragments from other files or templates. # -# This requires at least puppet 0.25 to work correctly as we use some +# This requires at least puppet 0.25 to work correctly as we use some # enhancements in recursive directory management and regular expressions # to do the work here. # # USAGE: # The basic use case is as below: # -# concat{"/etc/named.conf": +# concat{"/etc/named.conf": # notify => Service["named"] # } # @@ -17,7 +17,7 @@ # content => template("named_conf_zone.erb") # } # -# # add a fragment not managed by puppet so local users +# # add a fragment not managed by puppet so local users # # can add content to managed file # concat::fragment{"foo.com_user_config": # target => "/etc/named.conf", @@ -25,7 +25,7 @@ # ensure => "/etc/named.conf.local" # } # -# This will use the template named_conf_zone.erb to build a single +# This will use the template named_conf_zone.erb to build a single # bit of config up and put it into the fragments dir. The file # will have an number prefix of 10, you can use the order option # to control that and thus control the order the final file gets built in. @@ -39,16 +39,16 @@ # There's some regular expression magic to figure out the puppet version but # if you're on an older 0.24 version just set $puppetversion = 24 # -# Before you can use any of the concat features you should include the +# Before you can use any of the concat features you should include the # class concat::setup somewhere on your node first. # # DETAIL: # We use a helper shell script called concatfragments.sh that gets placed -# in /usr/local/bin to do the concatenation. While this might seem more +# in /usr/local/bin to do the concatenation. While this might seem more # complex than some of the one-liner alternatives you might find on the net -# we do a lot of error checking and safety checks in the script to avoid +# we do a lot of error checking and safety checks in the script to avoid # problems that might be caused by complex escaping errors etc. -# +# # LICENSE: # Apache Version 2 # @@ -56,13 +56,13 @@ # http://github.com/ripienaar/puppet-concat/ # # CONTACT: -# R.I.Pienaar <rip@devco.net> +# R.I.Pienaar <rip@devco.net> # Volcane on freenode # @ripienaar on twitter # www.devco.net -# Sets up so that you can use fragments to build a final config file, +# Sets up so that you can use fragments to build a final config file, # # OPTIONS: # - mode The mode of the final file @@ -78,15 +78,15 @@ # - Creates fragment directories if it didn't exist already # - Executes the concatfragments.sh script to build the final file, this script will create # directory/fragments.concat. Execution happens only when: -# * The directory changes -# * fragments.concat != final destination, this means rebuilds will happen whenever +# * The directory changes +# * fragments.concat != final destination, this means rebuilds will happen whenever # someone changes or deletes the final file. Checking is done using /usr/bin/cmp. # * The Exec gets notified by something else - like the concat::fragment define # - Copies the file over to the final destination using a file resource # # ALIASES: # - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"] -# - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"] +# - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"] define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $force = "false", $backup = "puppet") { $safe_name = regsubst($name, '/', '_', 'G') $concatdir = $concat::setup::concatdir @@ -123,7 +123,7 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $ file{$fragdir: ensure => directory; - "${fragdir}/fragments": + "${fragdir}/fragments": ensure => directory, recurse => true, purge => true, @@ -135,19 +135,19 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $ }, notify => Exec["concat_${name}"]; - "${fragdir}/fragments.concat": + "${fragdir}/fragments.concat": ensure => present; - "${fragdir}/${concat_name}": + "${fragdir}/${concat_name}": ensure => present; - $name: + $name: + ensure => present, source => "${fragdir}/${concat_name}", owner => $owner, group => $group, checksum => md5, mode => $mode, - ensure => present, alias => "concat_${name}"; } diff --git a/external/concat/manifests/setup.pp b/external/concat/manifests/setup.pp index 9676fb66..68beb901 100644 --- a/external/concat/manifests/setup.pp +++ b/external/concat/manifests/setup.pp @@ -7,29 +7,29 @@ # $puppetversion should be either 24 or 25 to enable a 24 compatible # mode, in 24 mode you might see phantom notifies this is a side effect # of the method we use to clear the fragments directory. -# +# # The regular expression below will try to figure out your puppet version # but this code will only work in 0.24.8 and newer. # # It also copies out the concatfragments.sh file to /usr/local/bin class concat::setup { - $concatdir = "/var/lib/puppet/concat" + $concatdir = '/var/lib/puppet/concat' $majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1') - file{"/usr/local/bin/concatfragments.sh": + file{'/usr/local/bin/concatfragments.sh': owner => root, group => root, - mode => 755, + mode => '0755', source => $majorversion ? { 24 => "puppet:///concat/concatfragments.sh", default => "puppet:///modules/concat/concatfragments.sh" }; - $concatdir: + $concatdir: ensure => directory, owner => root, group => root, - mode => 755; + mode => '0755'; } } |