Fix websockets ip address config
[integration/packaging/puppet-opendaylight.git] / manifests / install.pp
index 8eaa42670f2553f9c0b22679d5c786935ae12805..6f59c1f219b2fee5c3123b71354d11bc30216e4f 100644 (file)
@@ -1,10 +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 {
 
-  package { $::opendaylight::package_name:
-    ensure => present,
+  if $::opendaylight::manage_repositories {
+    require ::opendaylight::repos
+  }
+
+  package { 'opendaylight':
+    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,
+    }
   }
 }