From eac5a3c28c4773531964f77e25291c88efcc5e12 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Jan 2013 19:46:52 +0100 Subject: provide an easy option to still manage the source of the central conf file --- README | 11 ++++------- manifests/base.pp | 6 ++++++ manifests/init.pp | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README b/README index 29fd84d..f0b13cc 100644 --- a/README +++ b/README @@ -49,14 +49,11 @@ shorewall.conf, simply do this: NOTE: this requires the augeas ruby bindings newer than 0.7.3. -If you need to, you can provide an entire shorewall.conf by overriding the file -resource, for example: +If you need to, you can provide an entire shorewall.conf by passing its +source to the main class: -class site_shorewall::config inherits shorewall::base { - - File["/etc/shorewall/shorewall.conf"] { - source => "puppet:///modules/site_shorewall/${::fqdn}/shorewall.conf.${::operatingsystem}", - } +class{'shorewall': + conf_source => "puppet:///modules/site_shorewall/${::fqdn}/shorewall.conf.${::operatingsystem}", } NOTE: if you distribute a file, you cannot also use augeas, puppet and augeas diff --git a/manifests/base.pp b/manifests/base.pp index 52e77d8..4324553 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -16,6 +16,12 @@ class shorewall::base { owner => root, group => 0, mode => 0644; } + if $shorewall::conf_source { + File['/etc/shorewall/shorewall.conf']{ + source => $shorewall::conf_source, + } + } + augeas { 'shorewall_module_config_path': changes => 'set /files/etc/shorewall/shorewall.conf/CONFIG_PATH \'"/etc/shorewall/puppet:/etc/shorewall:/usr/share/shorewall"\'', lens => 'Shellvars.lns', diff --git a/manifests/init.pp b/manifests/init.pp index 63e6fd3..13eea89 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,5 +1,6 @@ class shorewall( $startup = '1', + $conf_source = false, $ensure_version = 'present', $tor_transparent_proxy_host = '127.0.0.1', $tor_transparent_proxy_port = '9040', -- cgit v1.2.3