Added parameter for odl_rest_port 89/55389/1
authorTim Rozet <tdrozet@gmail.com>
Wed, 4 Feb 2015 22:06:12 +0000 (17:06 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 19 Apr 2017 19:18:39 +0000 (15:18 -0400)
This is needed when combining with openstack as swift already uses
default 8080 port. odl_rest_port configures tomcat to change REST
API listen port.

Change-Id: Ief9af904a41ed74a1bdf923aaab1da15169c28a2
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
manifests/config.pp
manifests/init.pp
manifests/params.pp

index 9b9d485e1d5179ed12d65b641bd625372fa4a595..68d45b554b2e5166ffec264cfd1f3732cb423482 100644 (file)
@@ -2,7 +2,9 @@
 #
 # This class is called from opendaylight for service config.
 #
-class opendaylight::config {
+class opendaylight::config (
+   $odl_rest_port = $::opendaylight::params::odl_rest_port
+) inherits ::opendaylight::params {
   # This is very fragile, but I don't know of a better way to do it.
   # Updated ODL versions will break it, as will changes to the file upstream.
   file { 'org.apache.karaf.features.cfg':
@@ -10,4 +12,13 @@ class opendaylight::config {
     path    => '/opt/opendaylight-0.2.2/etc/org.apache.karaf.features.cfg',
     content => template('opendaylight/org.apache.karaf.features.cfg.erb'),
   }
+  
+  include stdlib
+  $myline= "    <Connector port=\"${odl_rest_port}\" protocol=\"HTTP/1.1\""
+  file_line { 'tomcatport':
+    ensure => present,
+    path => '/opt/opendaylight-0.2.2/configuration/tomcat-server.xml',
+    line => $myline,
+    match => '^\s*<Connector\s*port=\"[0-9]+\"\s*protocol=\"HTTP\/1.1\"$',
+  }
 }
index 4529db9fa4b9da89028344e568ed0181fa9a1321..bd536037e9bc016a94dd9326db20cb51cabc3094 100644 (file)
@@ -20,6 +20,7 @@ class opendaylight (
   $install_method = $::opendaylight::params::install_method,
   $tarball_url = $::opendaylight::params::tarball_url,
   $unitfile_url = $::opendaylight::params::unitfile_url,
+  $odl_rest_port = $::opendaylight::params::odl_rest_port
 ) inherits ::opendaylight::params {
 
   # NB: This is a work-around for a bug in gini/puppet-archive
@@ -50,11 +51,8 @@ class opendaylight (
     }
   }
 
-  # Build full list of features to install
-  $features = union($default_features, $extra_features)
-
   class { '::opendaylight::install': } ->
-  class { '::opendaylight::config': } ~>
+  class { '::opendaylight::config': odl_rest_port => $odl_rest_port} ~>
   class { '::opendaylight::service': } ->
   Class['::opendaylight']
 }
index 00a7e9bb8d5c9b100f187452877849834d537d34..f116350c646529366c1a33cf5818a80941e1b369 100644 (file)
@@ -9,4 +9,5 @@ class opendaylight::params {
   $install_method = 'rpm'
   $tarball_url = 'https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz'
   $unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
+  $odl_rest_port = '8080'
 }