Update OS distro/version support
[integration/packaging/puppet-opendaylight.git] / manifests / init.pp
1 # == Class: opendaylight
2 #
3 # OpenDaylight SDN Controller
4 #
5 # === Parameters
6 # [*default_features*]
7 #   Features that should normally be installed by default, but can be overridden.
8 # [*extra_features*]
9 #   List of features to install in addition to the default ones.
10 # [*odl_rest_port *]
11 #   Port for ODL northbound REST interface to listen on.
12 # [*install_method *]
13 #   How to install OpenDaylight. Current options are "rpm" and "tarball", default is RPM.
14 # [*tarball_url*]
15 #   If installing from a tarball, use this one. Defaults to latest ODL.
16 # [*unitfile_url*]
17 #   OpenDaylight .service file to use for tarball installs. Defaults to one used by ODL RPM.
18 # [*log_levels*]
19 #   Custom OpenDaylight logger verbosity configuration (TRACE, DEBUG, INFO, WARN, ERROR).
20 #
21 class opendaylight (
22   $default_features = $::opendaylight::params::default_features,
23   $extra_features = $::opendaylight::params::extra_features,
24   $install_method = $::opendaylight::params::install_method,
25   $tarball_url = $::opendaylight::params::tarball_url,
26   $unitfile_url = $::opendaylight::params::unitfile_url,
27   $odl_rest_port = $::opendaylight::params::odl_rest_port,
28   $enable_l3 = $::opendaylight::params::enable_l3,
29   $log_levels = $::opendaylight::params::log_levels,
30 ) inherits ::opendaylight::params {
31
32   # Validate OS family
33   case $::osfamily {
34     'RedHat': {}
35     'Debian': {
36         warning('Debian has limited support, is less stable, less tested.')
37     }
38     default: {
39         fail("Unsupported OS family: ${::osfamily}")
40     }
41   }
42
43   # Validate OS
44   case $::operatingsystem {
45     centos, redhat: {
46       if $::operatingsystemmajrelease != '7' {
47         # RHEL/CentOS versions < 7 not supported as they lack systemd
48         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
49       }
50     }
51     fedora: {
52       # Fedora distros < 22 are EOL as of 2015-12-01
53       # https://fedoraproject.org/wiki/End_of_life
54       if $::operatingsystemmajrelease < '22' {
55         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
56       }
57     }
58     ubuntu: {
59       if $::operatingsystemmajrelease != '14.04' {
60         # Only tested on 14.04
61         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
62       }
63     }
64     default: {
65       fail("Unsupported OS: ${::operatingsystem}")
66     }
67   }
68   # Build full list of features to install
69   $features = union($default_features, $extra_features)
70
71   class { '::opendaylight::install': } ->
72   class { '::opendaylight::config': } ~>
73   class { '::opendaylight::service': } ->
74   Class['::opendaylight']
75 }