fdef9c71de0eff8f4661965a7c132ddb752494e8
[genesis.git] / common / puppet-opnfv / manifests / compute.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 class opnfv::compute {
16   if ($odl_flag != '') and str2bool($odl_flag) { 
17      $ml2_mech_drivers = ['opendaylight']
18      $this_agent = 'opendaylight'
19   }
20   else {
21     $ml2_mech_drivers = ['openvswitch','l2population'] 
22     $this_agent = 'ovs'
23   }
24
25   if $ovs_tunnel_if == '' { fail('ovs_tunnel_if is empty') }
26   if $private_ip == '' { fail('private_ip is empty') }
27   if $odl_control_ip == '' { $odl_control_ip = $private_ip }
28
29   if $mysql_ip == '' { fail('mysql_ip is empty') }
30   if $amqp_ip == '' { fail('mysql_ip is empty') }
31
32   if $admin_password == '' { fail('admin_password is empty') }
33
34   if $nova_user_password == '' { fail('nova_user_password is empty') }
35   if $nova_db_password == '' { fail('nova_db_password is empty') }
36
37   if $neutron_user_password == '' { fail('nova_user_password is empty') }
38   if $neutron_db_password == '' { fail('nova_db_password is empty') }
39
40   if $ceilometer_user_password == '' { fail('ceilometer_user_password is empty') }
41   if $ceilometer_metering_secret == '' { fail('ceilometer_user_password is empty') }
42
43   class { "quickstack::neutron::compute":
44     auth_host                    => $private_ip,
45     glance_host                  => $private_ip,
46     libvirt_images_rbd_pool      => 'volumes',
47     libvirt_images_rbd_ceph_conf => '/etc/ceph/ceph.conf',
48     libvirt_inject_password      => 'false',
49     libvirt_inject_key           => 'false',
50     libvirt_images_type          => 'rbd',
51     nova_host                    => $private_ip,
52     nova_db_password              => $nova_db_password,
53     nova_user_password            => $nova_user_password,
54     private_network              => '',
55     private_iface                => '',
56     private_ip                   => '',
57     rbd_user                     => 'volumes',
58     rbd_secret_uuid              => '',
59     network_device_mtu           => $quickstack::params::network_device_mtu,
60
61     admin_password                => $admin_password,
62     ssl                           => false,
63
64     mysql_host                    => $mysql_ip,
65     mysql_ca                     => $quickstack::params::mysql_ca,
66     amqp_host                     => $amqp_ip,
67     amqp_username                 => 'guest',
68     amqp_password                 => 'guest',
69     #amqp_nssdb_password           => $quickstack::params::amqp_nssdb_password,
70
71     ceilometer                    => 'true',
72     ceilometer_metering_secret    => $ceilometer_metering_secret,
73     ceilometer_user_password      => $ceilometer_user_password,
74
75     cinder_backend_gluster        => $quickstack::params::cinder_backend_gluster,
76
77     agent_type                   => $this_agent,
78     enable_tunneling             => true,
79
80     ml2_mechanism_drivers        => $ml2_mech_drivers,
81     odl_controller_ip            => $odl_control_ip,
82
83     neutron_db_password          => $neutron_db_password,
84     neutron_user_password        => $neutron_user_password,
85     neutron_host                 => $private_ip,
86
87     #ovs_bridge_mappings          = $quickstack::params::ovs_bridge_mappings,
88     #ovs_bridge_uplinks           = $quickstack::params::ovs_bridge_uplinks,
89     #ovs_vlan_ranges              = $quickstack::params::ovs_vlan_ranges,
90     ovs_tunnel_iface             => $ovs_tunnel_if,
91     ovs_tunnel_network           => '',
92     ovs_l2_population            => 'True',
93
94     tenant_network_type          => 'vxlan',
95     tunnel_id_ranges             => '1:1000',
96     #ovs_vxlan_udp_port           = $quickstack::params::ovs_vxlan_udp_port,
97     ovs_tunnel_types             => ['vxlan'],
98
99     verbose                      => $quickstack::params::verbose,
100     security_group_api           => 'neutron',
101
102   }
103 }