Allow for disabling repository configuration
[integration/packaging/puppet-opendaylight.git] / manifests / install.pp
1 # == Class opendaylight::install
2 #
3 # Manages the installation of OpenDaylight.
4 #
5 # There are two install methods: RPM-based and deb-based. The resulting
6 # system state should be functionally equivalent.
7 #
8 class opendaylight::install {
9
10   if $::opendaylight::manage_repositories {
11     require ::opendaylight::repos
12   }
13
14   package { 'opendaylight':
15     ensure  => present,
16   }
17
18   if $::osfamily == 'RedHat' {
19     # Configure the systemd file with Java options
20     file_line { 'java_options_systemd':
21       ensure  => present,
22       path    => '/usr/lib/systemd/system/opendaylight.service',
23       line    => "Environment=_JAVA_OPTIONS=\'${::opendaylight::java_opts}\'",
24       match   => '^Environment.*',
25       after   => 'ExecStart=/opt/opendaylight/bin/start',
26       require => Package['opendaylight'],
27     }
28     ~>
29     exec {'reload_systemd_units':
30       command     => 'systemctl daemon-reload',
31       path        => '/bin',
32       refreshonly => true,
33     }
34   }
35 }