From 2ddafbd75b7bde2fac3e5293b824c727c5b3105a Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Thu, 3 May 2012 07:10:26 +0100 Subject: [PATCH] update for new idiom Signed-off-by: Stephen Gran --- modules/apache2/manifests/config.pp | 14 +++++++++----- modules/apache2/manifests/init.pp | 8 ++++---- modules/roles/manifests/dakmaster.pp | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/apache2/manifests/config.pp b/modules/apache2/manifests/config.pp index b67ddbee..9a111150 100644 --- a/modules/apache2/manifests/config.pp +++ b/modules/apache2/manifests/config.pp @@ -1,10 +1,14 @@ -define apache2::config($config = undef, $template = undef, $ensure = present) { +define apache2::config ( + $source=undef, + $content=undef, + $ensure=present +) { include apache2 case $ensure { present: { - if ! ($config or $template) { + if ! ($source or $content) { fail ( "No configuration found for ${name}" ) } } @@ -12,17 +16,17 @@ define apache2::config($config = undef, $template = undef, $ensure = present) { default: { fail ( "Unknown ensure value: '$ensure'" ) } } - if $template { + if $content { file { "/etc/apache2/conf.d/${name}": ensure => $ensure, - content => template($template), + content => $content, require => Package['apache2'], notify => Service['apache2'], } } else { file { "/etc/apache2/conf.d/${name}": ensure => $ensure, - source => $config, + source => $source, require => Package['apache2'], notify => Service['apache2'], } diff --git a/modules/apache2/manifests/init.pp b/modules/apache2/manifests/init.pp index 8c1afa14..082b8631 100644 --- a/modules/apache2/manifests/init.pp +++ b/modules/apache2/manifests/init.pp @@ -22,19 +22,19 @@ class apache2 { } apache2::config { 'ressource-limits': - template => 'apache2/ressource-limits.erb', + content => template('apache2/ressource-limits.erb'), } apache2::config { 'security': - config => 'puppet:///modules/apache2/security', + source => 'puppet:///modules/apache2/security', } apache2::config { 'local-serverinfo': - config => 'puppet:///modules/apache2/local-serverinfo', + source => 'puppet:///modules/apache2/local-serverinfo', } apache2::config { 'server-status': - config => 'puppet:///modules/apache2/server-status', + source => 'puppet:///modules/apache2/server-status', } file { '/etc/apache2/sites-available/common-ssl.inc': diff --git a/modules/roles/manifests/dakmaster.pp b/modules/roles/manifests/dakmaster.pp index 0cf923ad..7209befb 100644 --- a/modules/roles/manifests/dakmaster.pp +++ b/modules/roles/manifests/dakmaster.pp @@ -7,7 +7,7 @@ class roles::dakmaster { apache2::module { 'macro': } apache2::config { 'puppet-builddlist': - template => 'roles/dakmaster/conf-builddlist.erb', + content => template('roles/dakmaster/conf-builddlist.erb'), } } -- 2.39.2