From d8f6b340d382b10bfe492113dc2825a2dbbc0d92 Mon Sep 17 00:00:00 2001 From: ranjit Date: Mon, 29 Dec 2014 20:07:39 +0000 Subject: [PATCH] Added idempotency --- manifests/dev.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/dev.pp b/manifests/dev.pp index 6cc84d2..1047239 100644 --- a/manifests/dev.pp +++ b/manifests/dev.pp @@ -1,6 +1,8 @@ class grafanadash::dev() { # hack; there is probably a module for this - exec { '/usr/sbin/setenforce 0': } + exec { '/usr/sbin/setenforce 0': + unless => '/usr/sbin/getenforce | grep -c Disabled' + } # this is stupid, for anything other than dev service { 'iptables': @@ -32,6 +34,7 @@ # super hacky but for some reason the graphite database is coming up # as locked until we restart apache? exec { '/bin/sleep 10': - } -> - exec { '/sbin/service httpd restart': } + unless => "/usr/bin/wget -q -O /dev/null http://${::graphite::gr_web_servername}:${::graphite::gr_apache_port}", + notify => Service['httpd'], + } }