From 53c02c5007bd7fc6a31d37d38b36465fe68e8d6b Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Fri, 19 Jun 2015 23:18:40 +0200 Subject: [PATCH] refactoring --- manifests/instance.pp | 32 ++++++++++++------------- templates/instance/host-manager.xml.erb | 20 ---------------- templates/instance/manager.xml.erb | 20 ---------------- 3 files changed, 15 insertions(+), 57 deletions(-) delete mode 100644 templates/instance/host-manager.xml.erb delete mode 100644 templates/instance/manager.xml.erb diff --git a/manifests/instance.pp b/manifests/instance.pp index bc8ed45..1c013b0 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -965,32 +965,30 @@ 'package' : { $admin_webapps_path = $::osfamily ? { 'Debian' => "/usr/share/${::tomcat::admin_webapps_package_name_real}", - default => "\${catalina.home}/webapps" + default => '${catalina.home}/webapps' } } default : { - $admin_webapps_path = "\${catalina.home}/webapps" + $admin_webapps_path = '${catalina.home}/webapps' } } - file { "instance ${name} Catalina dir": - ensure => directory, - path => "${catalina_base_real}/conf/Catalina", - require => File["${catalina_base_real}/conf"] - } -> - file { "instance ${name} Catalina/${host_name} dir": - ensure => directory, - path => "${catalina_base_real}/conf/Catalina/${host_name}" + file { ["${catalina_base_real}/conf/Catalina","${catalina_base_real}/conf/Catalina/${host_name}"]: + ensure => directory } -> - file { + ::tomcat::context { "instance ${name} manager.xml": - ensure => present, - path => "${catalina_base_real}/conf/Catalina/${host_name}/manager.xml", - content => template("${module_name}/instance/manager.xml.erb"); + path => "${catalina_base_real}/conf/Catalina/${host_name}/manager.xml", + params => { 'path' => '/manager', + 'docBase' => "${admin_webapps_path}/manager", + 'antiResourceLocking' => false, + 'privileged' => 'true' }; "instance ${name} host-manager.xml": - ensure => present, - path => "${catalina_base_real}/conf/Catalina/${host_name}/host-manager.xml", - content => template("${module_name}/instance/host-manager.xml.erb") + path => "${catalina_base_real}/conf/Catalina/${host_name}/host-manager.xml", + params => { 'path' => '/host-manager', + 'docBase' => "${admin_webapps_path}/host-manager", + 'antiResourceLocking' => false, + 'privileged' => 'true' } } } else { # warn if admin webapps were selected for installation diff --git a/templates/instance/host-manager.xml.erb b/templates/instance/host-manager.xml.erb deleted file mode 100644 index 4e37cbb..0000000 --- a/templates/instance/host-manager.xml.erb +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/templates/instance/manager.xml.erb b/templates/instance/manager.xml.erb deleted file mode 100644 index bf00a5d..0000000 --- a/templates/instance/manager.xml.erb +++ /dev/null @@ -1,20 +0,0 @@ - - -