Fixes binding ODL to specific IP 16/55616/1
authorTim Rozet <tdrozet@gmail.com>
Sat, 5 Mar 2016 15:30:43 +0000 (10:30 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 19 Apr 2017 19:18:40 +0000 (15:18 -0400)
Change-Id: If30be706f18ad8d36270d8f23cf733cc85b3c7a1
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
manifests/init.pp
manifests/install.pp
manifests/params.pp
templates/jetty.xml.erb

index 6313e2296f3c172b4828b2cd527d93a3331a3c87..71ef7213e874cc175a08ff6f8b4fb5c190b6cfd5 100644 (file)
@@ -9,6 +9,8 @@
 #   List of features to install in addition to the default ones.
 # [*odl_rest_port *]
 #   Port for ODL northbound REST interface to listen on.
+# [*odl_bind_ip *]
+#   IP for ODL northbound REST interface to bind to.
 # [*install_method *]
 #   How to install OpenDaylight. Current options are "rpm" and "tarball", default is RPM.
 # [*tarball_url*]
 class opendaylight (
   $default_features = $::opendaylight::params::default_features,
   $extra_features = $::opendaylight::params::extra_features,
+  $odl_rest_port = $::opendaylight::params::odl_rest_port,
+  $odl_bind_ip = $::opendaylight::params::odl_bind_ip,
   $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,
   $enable_l3 = $::opendaylight::params::enable_l3,
   $log_levels = $::opendaylight::params::log_levels,
   $enable_ha = $::opendaylight::params::enable_ha,
index b9d60da39eb0af4ff2a7d2a53ebbbc325b52f90e..31ac6ae56dbe0c734fa4ee7f3114c0aaaf81f8d6 100644 (file)
@@ -35,6 +35,19 @@ class opendaylight::install {
       ensure  => present,
       require => Yumrepo['opendaylight-40-release'],
     }
+    ->
+    # Configure the systemd file to force ipv4 binds (instead of ipv6)
+    file_line { 'odl_start_ipv4 ':
+      ensure  => present,
+      path    => '/usr/lib/systemd/system/opendaylight.service',
+      line    => 'Environment=_JAVA_OPTIONS=\'-Djava.net.preferIPv4Stack=true\'',
+      after   => 'ExecStart=/opt/opendaylight/bin/start',
+    }
+    ->
+    exec {'reload_systemd_units':
+      command => 'systemctl daemon-reload',
+      path    => '/bin'
+    }
   }
   elsif $opendaylight::install_method == 'tarball' {
     # Install Java 7
index 9d51c2770a0823a4788d5b8be09386bc9df0efef..865505268a85b8668b16e6f1df17a35670fce46d 100644 (file)
@@ -11,6 +11,7 @@ class opendaylight::params {
   $default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
   $extra_features = []
   $odl_rest_port = '8080'
+  $odl_bind_ip = '0.0.0.0'
   $install_method = 'rpm'
   $tarball_url = 'https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium/distribution-karaf-0.4.0-Beryllium.tar.gz'
   $unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
index 2969fb234bd4bb5aeaa6b00174a55519c064c342..a5cae9d567aa8eadee680102be2f021a87a93bf2 100644 (file)
@@ -33,7 +33,7 @@ DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     <Call name="addConnector">
         <Arg>
             <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
-                <Set name="host">
+                <Set name="host"><%= scope.lookupvar('opendaylight::odl_bind_ip') %>
                     <Property name="jetty.host" />
                 </Set>
                 <Set name="port">
@@ -51,7 +51,7 @@ DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     <Call name="addConnector">
       <Arg>
         <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
-          <Set name="host">
+          <Set name="host"><%= scope.lookupvar('opendaylight::odl_bind_ip') %>
             <Property name="jetty.host" />
           </Set>
           <Set name="port">