try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / neutron / manifests / services / fwaas.pp
1 #
2 # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
3 #
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
16 # under the License.
17 #
18 #
19 # == Class: neutron::services::fwaas
20 #
21 # Configure the Firewall as a Service Neutron Plugin
22 #
23 # === Parameters:
24 #
25 # [*enabled*]
26 #   (required) Whether or not to enable the FWaaS neutron plugin Service
27 #   true/false
28 #
29 # [*driver*]
30 #   (optional) FWaaS Driver to use
31 #   Defaults to 'neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver'
32 #
33 # [*vpnaas_agent_package*]
34 #   (optional) Use VPNaaS agent package instead of L3 agent package on debian platforms
35 #   RedHat platforms won't take care of this parameter
36 #   true/false
37 #   Defaults to false
38 #
39
40 class neutron::services::fwaas (
41   $enabled              = true,
42   $driver               = 'neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver',
43   $vpnaas_agent_package = false
44 ) {
45
46   include neutron::params
47
48   if ($::osfamily == 'Debian') {
49     # Debian platforms
50     if $vpnaas_agent_package {
51       ensure_resource( 'package', $::neutron::params::vpnaas_agent_package,
52         { 'ensure' => $neutron::package_ensure })
53       Package[$::neutron::params::vpnaas_agent_package] -> Neutron_fwaas_service_config<||>
54     }
55     else {
56       ensure_resource( 'package', $::neutron::params::l3_agent_package,
57         { 'ensure' => $neutron::package_ensure })
58       Package[$::neutron::params::l3_agent_package] -> Neutron_fwaas_service_config<||>
59     }
60   } elsif($::osfamily == 'Redhat') {
61     # RH platforms
62     ensure_resource( 'package', $::neutron::params::package_name,
63       { 'ensure' => $neutron::package_ensure })
64     Package[$::neutron::params::package_name] -> Neutron_fwaas_service_config<||>
65   }
66
67   neutron_fwaas_service_config {
68     'fwaas/enabled': value => $enabled;
69     'fwaas/driver':  value => $driver;
70   }
71 }