Add docs for ODL OVSDB enable/disable L3 param
[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 # [*enable_l3*]
19 #   Enable or disable ODL OVSDB ML2 L3 forwarding. Valid options are 'yes' and 'no'.
20 # [*log_levels*]
21 #   Custom OpenDaylight logger verbosity configuration (TRACE, DEBUG, INFO, WARN, ERROR).
22 #
23 class opendaylight (
24   $default_features = $::opendaylight::params::default_features,
25   $extra_features = $::opendaylight::params::extra_features,
26   $install_method = $::opendaylight::params::install_method,
27   $tarball_url = $::opendaylight::params::tarball_url,
28   $unitfile_url = $::opendaylight::params::unitfile_url,
29   $odl_rest_port = $::opendaylight::params::odl_rest_port,
30   $enable_l3 = $::opendaylight::params::enable_l3,
31   $log_levels = $::opendaylight::params::log_levels,
32 ) inherits ::opendaylight::params {
33
34   # Validate OS family
35   case $::osfamily {
36     'RedHat': {}
37     'Debian': {
38         warning('Debian has limited support, is less stable, less tested.')
39     }
40     default: {
41         fail("Unsupported OS family: ${::osfamily}")
42     }
43   }
44
45   # Validate OS
46   case $::operatingsystem {
47     centos, redhat: {
48       if $::operatingsystemmajrelease != '7' {
49         # RHEL/CentOS versions < 7 not supported as they lack systemd
50         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
51       }
52     }
53     fedora: {
54       # Fedora distros < 22 are EOL as of 2015-12-01
55       # https://fedoraproject.org/wiki/End_of_life
56       if $::operatingsystemmajrelease < '22' {
57         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
58       }
59     }
60     ubuntu: {
61       if $::operatingsystemmajrelease != '14.04' {
62         # Only tested on 14.04
63         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
64       }
65     }
66     default: {
67       fail("Unsupported OS: ${::operatingsystem}")
68     }
69   }
70   # Build full list of features to install
71   $features = union($default_features, $extra_features)
72
73   class { '::opendaylight::install': } ->
74   class { '::opendaylight::config': } ~>
75   class { '::opendaylight::service': } ->
76   Class['::opendaylight']
77 }