diff --git a/hieradata/common.yaml b/hieradata/common.yaml index bc472b4..7b669b3 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -14,3 +14,4 @@ my::packages_no_conf: - libxml2-dev - libxml2-utils - links + - dsniff #tcpkill diff --git a/modules/tomcat8/manifests/init.pp b/modules/tomcat8/manifests/init.pp index f22724b..fee4c26 100644 --- a/modules/tomcat8/manifests/init.pp +++ b/modules/tomcat8/manifests/init.pp @@ -97,7 +97,7 @@ require => File["${install_dir}/tomcat8"], } exec { 'scp_config': - command => "scp -r -i ${keypath} -o StrictHostKeyChecking=no ${from}:/opt/tomcat8/conf/\\{server.xml, tomcat-users.xml\\} ${install_dir}/tomcat8/conf/", + 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", require => File["${install_dir}/tomcat8"], } @@ -105,6 +105,11 @@ owner => 'tomcat', require => Exec['scp_config'], } + exec {"clean_server.xml": + require => File["${install_dir}/tomcat8/conf/server.xml"], + command => "sed -i '128,168 d' ${install_dir}/tomcat8/conf/server.xml", ###XXX hardcoded line numbers + onlyif => "grep \"Context path\" ${install_dir}/tomcat8/conf/server.xml" + } file { "${install_dir}/tomcat8/conf/policy.d": require => Exec['scp_policy.d'], ensure => directory,