Permalink
Browse files

make module puppet style guide compliant

Test with puppet parser validate and puppet-lint.
http://docs.puppetlabs.com/guides/style_guide.html
  • Loading branch information...
antonlindstrom committed Mar 28, 2012
1 parent eac3705 commit 596e6732efb47f94ad1016d8da37b6578dc53a71
Showing with 279 additions and 274 deletions.
  1. +34 −34 manifests/config.pp
  2. +45 −47 manifests/hash.pp
  3. +74 −69 manifests/init.pp
  4. +7 −7 manifests/ldap.pp
  5. +11 −8 manifests/mailman.pp
  6. +20 −18 manifests/mta.pp
  7. +9 −9 manifests/satellite.pp
  8. +39 −41 manifests/transport.pp
  9. +39 −41 manifests/virtual.pp
  10. +1 −0 tests/init.pp
View
@@ -1,38 +1,38 @@
-/*
-== Definition: postfix::config
-
-Uses the "postconf" command to add/alter/remove options in postfix main
-configuation file (/etc/postfix/main.cf).
-
-Parameters:
-- *name*: name of the parameter.
-- *ensure*: present/absent. defaults to present.
-- *value*: value of the parameter.
-
-Requires:
-- Class["postfix"]
-
-Example usage:
-
- node "toto.example.com" {
-
- include postfix
-
- postfix::config {
- "smtp_use_tls" => "yes";
- "smtp_sasl_auth_enable" => "yes";
- "smtp_sasl_password_maps" => "hash:/etc/postfix/my_sasl_passwords";
- "relayhost" => "[mail.example.com]:587";
- }
- }
-
-*/
-define postfix::config ($ensure = present, $value) {
+#
+#== Definition: postfix::config
+#
+#Uses the "postconf" command to add/alter/remove options in postfix main
+#configuation file (/etc/postfix/main.cf).
+#
+#Parameters:
+#- *name*: name of the parameter.
+#- *ensure*: present/absent. defaults to present.
+#- *value*: value of the parameter.
+#
+#Requires:
+#- Class["postfix"]
+#
+#Example usage:
+#
+# node "toto.example.com" {
+#
+# include postfix
+#
+# postfix::config {
+# "smtp_use_tls" => "yes";
+# "smtp_sasl_auth_enable" => "yes";
+# "smtp_sasl_password_maps" => "hash:/etc/postfix/my_sasl_passwords";
+# "relayhost" => "[mail.example.com]:587";
+# }
+# }
+#
+#
+define postfix::config ($value, $ensure = present) {
Augeas {
- context => "/files/etc/postfix/main.cf",
- notify => Service["postfix"],
- require => File["/etc/postfix/main.cf"],
+ context => '/files/etc/postfix/main.cf',
+ notify => Service['postfix'],
+ require => File['/etc/postfix/main.cf'],
}
case $ensure {
@@ -41,11 +41,11 @@
changes => "set $name $value",
}
}
-
absent: {
augeas { "rm postfix '${name}'":
changes => "rm $name",
}
}
+ default: {}
}
}
View
@@ -1,42 +1,40 @@
-/*
-== Definition: postfix::hash
-
-Creates postfix hashed "map" files. It will create "${name}", and then build
-"${name}.db" using the "postmap" command. The map file can then be referred to
-using postfix::config.
-
-Parameters:
-- *name*: the name of the map file.
-- *ensure*: present/absent, defaults to present.
-- *source*: file source.
-
-Requires:
-- Class["postfix"]
-
-Example usage:
-
- node "toto.example.com" {
-
- include postfix
-
- postfix::hash { "/etc/postfix/virtual":
- ensure => present,
- }
- postfix::config { "virtual_alias_maps":
- value => "hash:/etc/postfix/virtual"
- }
- }
-
-*/
-define postfix::hash ($ensure="present", $source = false) {
+#== Definition: postfix::hash
+#
+#Creates postfix hashed "map" files. It will create "${name}", and then build
+#"${name}.db" using the "postmap" command. The map file can then be referred to
+#using postfix::config.
+#
+#Parameters:
+#- *name*: the name of the map file.
+#- *ensure*: present/absent, defaults to present.
+#- *source*: file source.
+#
+#Requires:
+#- Class["postfix"]
+#
+#Example usage:
+#
+# node "toto.example.com" {
+#
+# include postfix
+#
+# postfix::hash { "/etc/postfix/virtual":
+# ensure => present,
+# }
+# postfix::config { "virtual_alias_maps":
+# value => "hash:/etc/postfix/virtual"
+# }
+# }
+#
+define postfix::hash ($ensure='present', $source = false) {
# selinux labels differ from one distribution to another
- case $operatingsystem {
+ case $::operatingsystem {
RedHat, CentOS: {
- case $lsbmajdistrelease {
- "4": { $postfix_seltype = "etc_t" }
- "5","6": { $postfix_seltype = "postfix_etc_t" }
+ case $::lsbmajdistrelease {
+ '4': { $postfix_seltype = 'etc_t' }
+ '5','6': { $postfix_seltype = 'postfix_etc_t' }
default: { $postfix_seltype = undef }
}
}
@@ -48,40 +46,40 @@
case $source {
false: {
- file {"${name}":
+ file {$name:
ensure => $ensure,
- mode => 600,
+ mode => '0600',
owner => root,
group => root,
seltype => $postfix_seltype,
- require => Package["postfix"],
+ require => Package['postfix'],
}
}
default: {
- file {"${name}":
+ file {$name:
ensure => $ensure,
- mode => 600,
+ mode => '0600',
owner => root,
group => root,
source => $source,
seltype => $postfix_seltype,
- require => Package["postfix"],
+ require => Package['postfix'],
}
}
}
file {"${name}.db":
ensure => $ensure,
- mode => 600,
- require => [File["${name}"], Exec["generate ${name}.db"]],
+ mode => '0600',
+ require => [File[$name], Exec["generate ${name}.db"]],
seltype => $postfix_seltype,
}
exec {"generate ${name}.db":
- command => "postmap ${name}",
- #creates => "${name}.db", # this prevents postmap from being run !
- subscribe => File["${name}"],
+ command => "postmap ${name}",
+ #creates => "${name}.db", # this prevents postmap from being run !
+ subscribe => File[$name],
refreshonly => true,
- require => Package["postfix"],
+ require => Package['postfix'],
}
}
Oops, something went wrong.

0 comments on commit 596e673

Please sign in to comment.