summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2018-01-08 14:21:43 +0000
committerintrigeri <intrigeri@boum.org>2018-01-08 14:21:43 +0000
commit9c41dbf6ce3df03527e0491b13840e4124ed22bf (patch)
tree5a911e12ac258cdeb47c520687e4c3b2ae2716cf
parentcebe42c1bcf7ebfbb989c1b6a7d416d98c947e64 (diff)
parent425ad79683e59603f83e6484a2e32804273d4339 (diff)
Merge branch 'config_ensure' into 'master'
implement ensure absent for postfix::config See merge request shared-puppet-modules-group/postfix!16
-rw-r--r--README.md11
-rw-r--r--manifests/config.pp4
2 files changed, 13 insertions, 2 deletions
diff --git a/README.md b/README.md
index 7a6b01f..c7646a9 100644
--- a/README.md
+++ b/README.md
@@ -122,9 +122,13 @@ Convience classes
postfix::config
---------------
-this can be used to pass arbitrary postfix configurations by passing the $name
+This can be used to pass arbitrary postfix configurations by passing the $name
to postconf to add/alter/remove options in main.cf
+It can also be used to ensure that a certain configuration is not present by
+setting the ensure parameter to absent. In this case, the value parameter is
+still mandatory but can be set to whatever value.
+
Parameters:
- *name*: name of the parameter.
- *ensure*: present/absent. defaults to present.
@@ -144,6 +148,11 @@ Example usage:
"relayhost" => "[mail.example.com]:587";
}
+ postfix::config { 'smtp_tls_cert_file':
+ ensure => absent,
+ value => '',
+ }
+
postfix::disable
----------------
diff --git a/manifests/config.pp b/manifests/config.pp
index ce7af9e..a1eb651 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -43,7 +43,9 @@ define postfix::config ($ensure = present, $value, $nonstandard = false) {
}
absent: {
- fail "postfix::config ensure => absent: Not implemented"
+ exec { "postconf -X ${name}":
+ unless => "test \"x$(postconf -n ${name})\" = \"x\"",
+ }
}
}
}