|
6 | 6 | # system state should be functionally equivalent. |
7 | 7 | # |
8 | 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', |
18 | | - enabled => 1, |
19 | | - # NB: RPM signing is an active TODO, but is not done. We will enable |
20 | | - # this gpgcheck once the RPM supports it. |
21 | | - gpgcheck => 0, |
22 | | - before => Package['opendaylight'], |
23 | | - } |
24 | 9 |
|
25 | | - # Install the OpenDaylight RPM |
26 | | - package { 'opendaylight': |
27 | | - ensure => present, |
28 | | - require => Yumrepo[$opendaylight::rpm_repo], |
29 | | - } |
30 | | - -> |
| 10 | + if $::opendaylight::manage_repositories { |
| 11 | + require ::opendaylight::repos |
| 12 | + } |
| 13 | + |
| 14 | + package { 'opendaylight': |
| 15 | + ensure => present, |
| 16 | + } |
| 17 | + |
| 18 | + if $::osfamily == 'RedHat' { |
31 | 19 | # Configure the systemd file with Java options |
32 | 20 | file_line { 'java_options_systemd': |
33 | | - ensure => present, |
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', |
| 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'], |
38 | 27 | } |
39 | 28 | ~> |
40 | 29 | exec {'reload_systemd_units': |
|
43 | 32 | refreshonly => true, |
44 | 33 | } |
45 | 34 | } |
46 | | - |
47 | | - elsif $::osfamily == 'Debian'{ |
48 | | - |
49 | | - include apt |
50 | | - |
51 | | - # Add ODL ppa repository |
52 | | - apt::ppa{ $opendaylight::deb_repo: } |
53 | | - |
54 | | - # Install Opendaylight .deb pkg |
55 | | - package { 'opendaylight': |
56 | | - ensure => present, |
57 | | - require => Apt::Ppa[$opendaylight::deb_repo], |
58 | | - } |
59 | | - |
60 | | - Apt::Ppa[$opendaylight::deb_repo] -> Package['opendaylight'] |
61 | | - } |
62 | | - else { |
63 | | - fail("Unknown operating system method: ${::osfamily}") |
64 | | - } |
65 | 35 | } |
0 commit comments