1 # == Class opendaylight::install
3 # Manages the installation of OpenDaylight.
5 # There are two install methods: RPM-based and deb-based. The resulting
6 # system state should be functionally equivalent.
8 class opendaylight::install {
9 if $::osfamily == 'RedHat' {
10 # Add OpenDaylight's Yum repository
11 yumrepo { $opendaylight::rpm_repo:
12 # 'ensure' isn't supported with Puppet <3.5
13 # Seems to default to present, but docs don't say
14 # https://docs.puppetlabs.com/references/3.4.0/type.html#yumrepo
15 # https://docs.puppetlabs.com/references/3.5.0/type.html#yumrepo
16 baseurl => "http://cbs.centos.org/repos/nfv7-${opendaylight::rpm_repo}/\$basearch/os/",
17 descr => 'OpenDaylight SDN Controller',
19 # NB: RPM signing is an active TODO, but is not done. We will enable
20 # this gpgcheck once the RPM supports it.
22 before => Package['opendaylight'],
25 # Install the OpenDaylight RPM
26 package { 'opendaylight':
28 require => Yumrepo[$opendaylight::rpm_repo],
31 # Configure the systemd file with Java options
32 file_line { 'java_options_systemd':
34 path => '/usr/lib/systemd/system/opendaylight.service',
35 line => "Environment=_JAVA_OPTIONS=\'${opendaylight::java_opts}\'",
36 match => '^Environment.*',
37 after => 'ExecStart=/opt/opendaylight/bin/start',
40 exec {'reload_systemd_units':
41 command => 'systemctl daemon-reload',
47 elsif $::osfamily == 'Debian'{
51 # Add ODL ppa repository
52 apt::ppa{ $opendaylight::deb_repo: }
54 # Install Opendaylight .deb pkg
55 package { 'opendaylight':
57 require => Apt::Ppa[$opendaylight::deb_repo],
60 Apt::Ppa[$opendaylight::deb_repo] -> Package['opendaylight']
63 fail("Unknown operating system method: ${::osfamily}")