Fix websockets ip address config
[integration/packaging/puppet-opendaylight.git] / manifests / install.pp
index 1b03f89f88d5b4fe0b22aef51699e6326ac6880b..6f59c1f219b2fee5c3123b71354d11bc30216e4f 100644 (file)
@@ -1,19 +1,34 @@
 # == Class opendaylight::install
 #
-# This class is called from opendaylight for install.
+# Manages the installation of OpenDaylight.
+#
+# There are two install methods: RPM-based and deb-based. The resulting
+# system state should be functionally equivalent.
 #
 class opendaylight::install {
 
-  yumrepo { 'opendaylight':
-    # 'ensure' isn't supported with Puppet <3.5
-    #ensure   => 'present',
-    descr    => 'OpenDaylight SDN controller',
-    baseurl  => 'http://104.131.189.230/repository/',
-    gpgcheck => False,
-    enabled  => True,
+  if $::opendaylight::manage_repositories {
+    require ::opendaylight::repos
+  }
+
+  package { 'opendaylight':
+    ensure  => present,
   }
 
-  package { $::opendaylight::package_name:
-    ensure => present,
+  if $::osfamily == 'RedHat' {
+    # Configure the systemd file with Java options
+    file_line { 'java_options_systemd':
+      ensure  => present,
+      path    => '/usr/lib/systemd/system/opendaylight.service',
+      line    => "Environment=_JAVA_OPTIONS=\'${::opendaylight::java_opts}\'",
+      match   => '^Environment.*',
+      after   => 'ExecStart=/opt/opendaylight/bin/start',
+      require => Package['opendaylight'],
+    }
+    ~> exec {'reload_systemd_units':
+      command     => 'systemctl daemon-reload',
+      path        => '/bin',
+      refreshonly => true,
+    }
   }
 }