1 # == Class opendaylight::install
3 # This class is called from opendaylight for install.
5 class opendaylight::install {
6 if $opendaylight::install_method == 'rpm' {
7 # Choose Yum URL based on OS (CentOS vs Fedora)
8 $base_url = $::operatingsystem ? {
9 'CentOS' => 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/',
10 'Fedora' => 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/fedora-$releasever-$basearch/',
13 yumrepo { 'opendaylight':
14 # 'ensure' isn't supported with Puppet <3.5
15 # Seems to default to present, but docs don't say
16 # https://docs.puppetlabs.com/references/3.4.0/type.html#yumrepo
17 # https://docs.puppetlabs.com/references/3.5.0/type.html#yumrepo
19 descr => 'OpenDaylight SDN controller',
22 before => Package['opendaylight'],
25 package { 'opendaylight':
27 require => Yumrepo['opendaylight'],
30 elsif $opendaylight::install_method == 'tarball' {
31 # Download and extract the ODL tarball
32 archive { 'opendaylight-0.2.2':
34 url => $opendaylight::tarball_url,
37 # This discards top-level dir of extracted tarball
38 # Required to get proper /opt/opendaylight-<version> path
39 # Ideally, camptocamp/puppet-archive would support this. PR later?
40 strip_components => 1,
43 # TODO: Download ODL systemd .service file and put in right location
46 fail("Unknown install method: ${opendaylight::install_method}")