diff --git a/modules/probe/manifests/init.pp b/modules/probe/manifests/init.pp index 426ad56..e1a2032 100644 --- a/modules/probe/manifests/init.pp +++ b/modules/probe/manifests/init.pp @@ -1,3 +1,4 @@ +Exec {path => ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin"]} class probe( $source_dir = hiera('probe::source_dir', '/opt/sources' ), $tomcat_webapps = hiera('probe::tomcat_webapps', '/var/lib/tomcat8/webapps'), @@ -5,7 +6,18 @@ ){ exec{'install_probe': command => "sudo ${::settings::modulepath}/scripts/probe.sh $source_dir $tomcat_webapps", - creates => "$tomcat_webapps/probe.war", - require => Class["tomcat8"], + unless => "test -s ${tomcat_webapps}/probe.war", + #require => Class["tomcat8"], } + exec{'checkout':} + com + + file{"${tomcat_webapps}/probe.war": + require => Exec['install_probe'], + owner => 'tomcat', + ensure => file, + } + } + +class {'probe':} diff --git a/modules/scripts/probe.sh b/modules/scripts/probe.sh old mode 100644 new mode 100755 index f5f9026..fc19ff1 --- a/modules/scripts/probe.sh +++ b/modules/scripts/probe.sh @@ -3,8 +3,12 @@ SOURCE=$1 TOMCAT_WEBAPPS=$3 pushd $SOURCE -git clone https://github.com/psi-probe/psi-probe && pushd psi-probe -mvn package +if [ -d psi-probe ]; then + pushd psi-probe && git pull +else + git clone https://github.com/psi-probe/psi-probe && pushd psi-probe +fi +mvn package -Dmaven.test.skip=true cp web/target/probe.war $TOMCAT_WEBAPPS/ popd popd diff --git a/modules/tomcat8/manifests/init.pp b/modules/tomcat8/manifests/init.pp index fee4c26..fadcd42 100644 --- a/modules/tomcat8/manifests/init.pp +++ b/modules/tomcat8/manifests/init.pp @@ -98,7 +98,7 @@ } exec { 'scp_config': command => "scp -r -i ${keypath} -o StrictHostKeyChecking=no ${from}:/opt/tomcat8/conf/server.xml ${install_dir}/tomcat8/conf/ && scp -r -i ${keypath} -o StrictHostKeyChecking=no ${from}:/opt/tomcat8/conf/tomcat-users.xml ${install_dir}/tomcat8/conf/", - unless => "grep \"admin\" ${install_dir}/tomcat8/conf/tomcat_users.xml", + unless => "grep \"admin\" ${install_dir}/tomcat8/conf/tomcat-users.xml", require => File["${install_dir}/tomcat8"], } file { ["${install_dir}/tomcat8/conf/server.xml","${install_dir}/tomcat8/conf/tomcat-users.xml"]: