Configures static ip on private and admin interfaces for nodes
[genesis.git] / common / puppet-opnfv / manifests / network.pp
1 #Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
2 #
3 #   Licensed under the Apache License, Version 2.0 (the "License");
4 #   you may not use this file except in compliance with the License.
5 #   You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #   Unless required by applicable law or agreed to in writing, software
10 #   distributed under the License is distributed on an "AS IS" BASIS,
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #   See the License for the specific language governing permissions and
13 #   limitations under the License.
14
15
16 class opnfv::network {
17   ###use 8081 as a default work around swift service
18   if $odl_rest_port == '' {$odl_rest_port = '8081'}
19
20   if ($odl_flag != '') and str2bool($odl_flag) {
21      $ml2_mech_drivers = ['opendaylight']
22      $this_agent = 'opendaylight'
23      class {"opendaylight":
24        odl_rest_port => $odl_rest_port,
25        extra_features => ['odl-base-all', 'odl-aaa-authn', 'odl-restconf', 'odl-nsf-all', 'odl-adsal-northbound', 'odl-mdsal-apidocs', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound', 'odl-dlux-core'],
26      }
27   }
28   else {
29     $ml2_mech_drivers = ['openvswitch','l2population']
30     $this_agent = 'ovs'
31   }
32
33
34
35   if $ovs_tunnel_if == '' { fail('ovs_tunnel_if is empty') }
36   if $private_ip == '' { fail('private_ip is empty') }
37
38   if $odl_control_ip == '' { fail('odl_controL_ip is empty, should be the IP of your network node private interface') }
39
40   if $mysql_ip == '' { fail('mysql_ip is empty') }
41   if $amqp_ip == '' { fail('amqp_ip is empty') }
42
43   if $nova_user_password == '' { fail('nova_user_password is empty') }
44   if $nova_db_password == '' { fail('nova_db_password is empty') }
45
46   if $neutron_user_password == '' { fail('neutron_user_password is empty') }
47   if $neutron_db_password == '' { fail('neutron_db_password is empty') }
48   if $neutron_metadata_shared_secret == '' { fail('neutron_metadata_shared_secret is empty') }
49
50   class { "quickstack::neutron::networker":
51     agent_type                    => $this_agent,
52     neutron_metadata_proxy_secret => $neutron_metadata_shared_secret,
53     neutron_db_password           => $neutron_db_password,
54     neutron_user_password         => $neutron_user_password,
55     nova_db_password              => $nova_db_password,
56     nova_user_password            => $nova_user_password,
57
58     controller_priv_host          => $private_ip,
59
60     enable_tunneling              => true,
61     ovs_tunnel_iface              => $ovs_tunnel_if,
62     ovs_tunnel_network            => '',
63     ovs_l2_population             => 'True',
64     ovs_tunnel_types              => ['vxlan'],
65     external_network_bridge       => 'br-ex',
66     tenant_network_type           => 'vxlan',
67     tunnel_id_ranges              => '1:1000',
68
69     mysql_host                    => $mysql_ip,
70     amqp_host                     => $amqp_ip,
71     amqp_username                 => 'guest',
72     amqp_password                 => 'guest',
73
74     ml2_mechanism_drivers        => $ml2_mech_drivers,
75     odl_controller_ip            => $odl_control_ip,
76   }
77 }