From d3658027fae14a037d99de27916b777ded23c944 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 30 May 2013 23:03:46 -0300 Subject: Checking if avahi is enabled at nodo::role::nas --- manifests/role/nas.pp | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'manifests/role') diff --git a/manifests/role/nas.pp b/manifests/role/nas.pp index bae8b66..0d32a7d 100644 --- a/manifests/role/nas.pp +++ b/manifests/role/nas.pp @@ -84,12 +84,18 @@ class nodo::role::nas { } file { '/etc/avahi/services/ftp.service': - ensure => present, + ensure => $avahi ? { + true => present, + default => absent, + }, owner => root, group => root, mode => 0644, source => 'puppet:///modules/site_avahi/services/ftp.service', - notify => Service['avahi-daemon'], + notify => $avahi ? { + true => Service['avahi-daemon'], + default => undef, + }, } } @@ -137,12 +143,18 @@ class nodo::role::nas { } file { '/etc/avahi/services/samba.service': - ensure => present, + ensure => $avahi ? { + true => present, + default => absent, + }, owner => root, group => root, mode => 0644, source => 'puppet:///modules/site_avahi/services/samba.service', - notify => Service['avahi-daemon'], + notify => $avahi ? { + true => Service['avahi-daemon'], + default => undef, + }, } } @@ -168,12 +180,18 @@ class nodo::role::nas { } file { '/etc/avahi/services/http.service': - ensure => present, + ensure => $avahi ? { + true => present, + default => absent, + }, owner => root, group => root, mode => 0644, source => 'puppet:///modules/site_avahi/services/http.service', - notify => Service['avahi-daemon'], + notify => $avahi ? { + true => Service['avahi-daemon'], + default => undef, + }, } } @@ -201,12 +219,18 @@ class nodo::role::nas { include rsync::server file { '/etc/avahi/services/rsync.service': - ensure => present, + ensure => $avahi ? { + true => present, + default => absent, + }, owner => root, group => root, mode => 0644, source => 'puppet:///modules/site_avahi/services/rsync.service', - notify => Service['avahi-daemon'], + notify => $avahi ? { + true => Service['avahi-daemon'], + default => undef, + }, } } -- cgit v1.2.3