Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Test and remove array of folders?

$
0
0
I'm looking to make the following code work somehow, it seems if i do not test the files/folders first I end up with the error `Error: Failed to apply catalog: Parameter path failed on File[/opt/dynatrace-6.2]: File paths must be fully qualified, not '["/opt/dynatrace-6.2", "/opt/dynatrace-5.6.0", "/opt/rh/httpd24/root/etc/httpd/conf.d/dtload.conf", "/opt/rh/httpd24/root/etc/httpd/conf.d/01_dtagent.conf"]' at newrelic.pp:35` The pertinent parts $dtdeps = [ "/opt/dynatrace-6.2", "/opt/dynatrace-5.6.0", "${httpd_root}/conf.d/dtload.conf", "${httpd_root}/conf.d/01_dtagent.conf", ] exec { "check_presence": require => File[$dtdeps], command => '/bin/true', onlyif => "/usr/bin/test -e $dtdeps", } file { $dtdeps: require => Exec["check_presence"], path => $dtdeps, ensure => absent, recurse => true, purge => true, force => true, } ## this is line 35 btw exec { "stop_dt_agent": command => "PID=$(ps ax |grep dtwsagent |grep -v grep |awk '{print$1}') ; [ ! -z $PID ] && kill -9 $PID", provider => shell, } service { "httpd_restart" : ensure => running, enable => true, restart => "/usr/sbin/apachectl configtest && /etc/init.d/httpd reload", subscribe => Package["httpd"], }

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>