From: Tim Rozet Date: Wed, 13 Sep 2017 18:21:54 +0000 (-0400) Subject: Fixes configuring jetty.xml X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=4fa363098e550d4d57245d0347763765a8291088;p=integration%2Fpackaging%2Fpuppet-opendaylight.git Fixes configuring jetty.xml In Nitrogen and later the template configuration for jetty.xml is incorrect and ODL does not start correctly. This patch removes the template in favor of using augeas. Also updates acceptance to use nitrogen (since oxygen repo not available). Change-Id: Ia5cf466cb8ba2596d1df0fa4f2d5956827206e46 Signed-off-by: Tim Rozet --- diff --git a/Rakefile b/Rakefile index e7a176a..2de9aa3 100644 --- a/Rakefile +++ b/Rakefile @@ -26,14 +26,14 @@ end desc "Beaker tests against CentOS 7 VM with latest Carbon testing RPM" task :cent_6test_vm do - sh "RS_SET=centos-7 RPM_REPO='opendaylight-6-testing' bundle exec rake beaker" + sh "RS_SET=centos-7 RPM_REPO='opendaylight-7-testing' bundle exec rake beaker" end # CentOS Containers desc "Beaker tests against CentOS 7 container with latest Carbon testing RPM" task :cent_6test_dock do - sh "RS_SET=centos-7-docker RPM_REPO='opendaylight-6-testing' bundle exec rake beaker" + sh "RS_SET=centos-7-docker RPM_REPO='opendaylight-7-testing' bundle exec rake beaker" end # Ubuntu VMs diff --git a/manifests/config.pp b/manifests/config.pp index 69723f1..f508999 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -19,15 +19,17 @@ class opendaylight::config { match => '^featuresBoot=.*$', } - # Configuration of ODL NB REST port to listen on - file { 'jetty.xml': - ensure => file, - path => '/opt/opendaylight/etc/jetty.xml', - # Set user:group owners - owner => 'odl', - group => 'odl', - # Use a template to populate the content - content => template('opendaylight/jetty.xml.erb'), + # Configuration of ODL NB REST port and IP to listen on + augeas {'jetty.xml': + incl => '/opt/opendaylight/etc/jetty.xml', + context => '/files/opt/opendaylight/etc/jetty.xml/Configure', + lens => 'Xml.lns', + changes => [ + "set Call[2]/Arg/New/Set[#attribute[name='port']]/Property/#attribute/default ${opendaylight::odl_rest_port}", + "set Call[1]/Arg/New/Set[#attribute[name='host']]/#text[1] ${opendaylight::odl_bind_ip}", + "rm Call[1]/Arg/New/Set[#attribute[name='host']]/Property", + "set Call[2]/Arg/New/Set[#attribute[name='host']]/#text[1] ${opendaylight::odl_bind_ip}", + "rm Call[2]/Arg/New/Set[#attribute[name='host']]/Property"] } # Set any custom log levels diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 00b21fd..1726a30 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -123,13 +123,7 @@ def odl_rest_port_tests(options = {}) # NB: These hashes don't work with Ruby 1.8.7, but we # don't support 1.8.7 so that's okay. See issue #36. it { - should contain_file('jetty.xml').with( - 'ensure' => 'file', - 'path' => '/opt/opendaylight/etc/jetty.xml', - 'owner' => 'odl', - 'group' => 'odl', - 'content' => /Property name="jetty.port" default="#{odl_rest_port}"/ - ) + should contain_augeas('jetty.xml') } end diff --git a/templates/jetty.xml.erb b/templates/jetty.xml.erb deleted file mode 100644 index a5cae9d..0000000 --- a/templates/jetty.xml.erb +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - <%= scope.lookupvar('opendaylight::odl_bind_ip') %> - - - - - - 300000 - 2 - false - 8543 - 20000 - 5000 - - - - - - - <%= scope.lookupvar('opendaylight::odl_bind_ip') %> - - - - - - 300000 - 2 - false - 8443 - 20000 - 5000 - - - - - - - - - - - - - - - karaf - karaf - - - org.apache.karaf.jaas.boot.principal.RolePrincipal - - - - - - - - - - default - karaf - - - org.apache.karaf.jaas.boot.principal.RolePrincipal - - - - - - - -