Added custom Rake commands for Beaker tests
[integration/packaging/puppet-opendaylight.git] / manifests / init.pp
1 # == Class: opendaylight
2 #
3 # OpenDaylight SDN Controller
4 #
5 # === Parameters
6 #
7 # [*sample_parameter*]
8 #   Explanation of what this parameter affects and what it defaults to.
9 #
10 class opendaylight (
11   $package_name = $::opendaylight::params::package_name,
12   $service_name = $::opendaylight::params::service_name,
13 ) inherits ::opendaylight::params {
14
15   # Validate OS
16   case $::operatingsystem {
17     centos, redhat: {
18       if $::operatingsystemmajrelease != 7 {
19         # RHEL/CentOS versions < 7 not supported as they lack systemd
20         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
21       }
22     }
23     fedora: {
24       # Fedora distros < 20 are EOL as of Jan 6th 2015
25       if ! ($::operatingsystemmajrelease in [20, 21]) {
26         # Fedora versions < 19 can't be build on Copr, >21 don't exist
27         fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
28       }
29     }
30     default: {
31       fail("Unsupported OS: ${::operatingsystem}")
32     }
33   }
34
35   class { '::opendaylight::install': } ->
36   class { '::opendaylight::config': } ~>
37   class { '::opendaylight::service': } ->
38   Class['::opendaylight']
39 }