Skip to content

Commit

Permalink
broken...
Browse files Browse the repository at this point in the history
  • Loading branch information
kosarko committed Jun 26, 2015
1 parent c7dc71f commit 5869ce3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
16 changes: 14 additions & 2 deletions modules/probe/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
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'),
$ensure = 'installed',
){
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':}
8 changes: 6 additions & 2 deletions modules/scripts/probe.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion modules/tomcat8/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit 5869ce3

Please sign in to comment.