1 # Copyright 2014 Red Hat, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
16 include ::tripleo::packages
17 include ::tripleo::firewall
19 create_resources(kmod::load, hiera('kernel_modules'), {})
20 create_resources(sysctl::value, hiera('sysctl_settings'), {})
21 Exec <| tag == 'kmod::load' |> -> Sysctl <| |>
23 if count(hiera('ntp::servers')) > 0 {
29 file { ['/etc/libvirt/qemu/networks/autostart/default.xml',
30 '/etc/libvirt/qemu/networks/default.xml']:
32 before => Service['libvirt'],
34 # in case libvirt has been already running before the Puppet run, make
35 # sure the default network is destroyed
36 exec { 'libvirt-default-net-destroy':
37 command => '/usr/bin/virsh net-destroy default',
38 onlyif => '/usr/bin/virsh net-info default | /bin/grep -i "^active:\s*yes"',
39 before => Service['libvirt'],
42 # When utilising images for deployment, we need to reset the iSCSI initiator name to make it unique
43 exec { 'reset-iscsi-initiator-name':
44 command => '/bin/echo InitiatorName=$(/usr/sbin/iscsi-iname) > /etc/iscsi/initiatorname.iscsi',
45 onlyif => '/usr/bin/test ! -f /etc/iscsi/.initiator_reset',
48 file { '/etc/iscsi/.initiator_reset':
53 include ::nova::config
54 include ::nova::compute
57 'DEFAULT/my_ip': value => $ipaddress;
58 'DEFAULT/linuxnet_interface_driver': value => 'nova.network.linux_net.LinuxOVSInterfaceDriver';
59 'DEFAULT/host': value => $fqdn;
62 $rbd_ephemeral_storage = hiera('nova::compute::rbd::ephemeral_storage', false)
63 $rbd_persistent_storage = hiera('rbd_persistent_storage', false)
64 if $rbd_ephemeral_storage or $rbd_persistent_storage {
66 include ::ceph::profile::client
68 $client_keys = hiera('ceph::profile::params::client_keys')
69 $client_user = join(['client.', hiera('ceph_client_user_name')])
70 class { '::nova::compute::rbd':
71 libvirt_rbd_secret_key => $client_keys[$client_user]['secret'],
75 if hiera('cinder_enable_nfs_backend', false) {
76 if str2bool($::selinux) {
77 selboolean { 'virt_use_nfs':
80 } -> Package['nfs-utils']
83 package {'nfs-utils': } -> Service['nova-compute']
86 include ::nova::compute::libvirt
87 if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
88 file {'/etc/libvirt/qemu.conf':
90 content => hiera('midonet_libvirt_qemu_data')
93 include ::nova::network::neutron
95 include ::neutron::config
97 # If the value of core plugin is set to 'nuage',
98 # include nuage agent,
99 # If the value of core plugin is set to 'midonet',
100 # include midonet agent,
101 # else use the default value of 'ml2'
102 if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' {
104 include ::nova::compute::neutron
106 class { '::nuage::metadataagent':
107 nova_os_tenant_name => hiera('nova::api::admin_tenant_name'),
108 nova_os_password => hiera('nova_password'),
109 nova_metadata_ip => hiera('nova_metadata_node_ips'),
110 nova_auth_ip => hiera('keystone_public_api_virtual_ip'),
113 elsif hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
115 # TODO(devvesa) provide non-controller ips for these services
116 $zookeeper_node_ips = hiera('neutron_api_node_ips')
117 $cassandra_node_ips = hiera('neutron_api_node_ips')
119 class {'::tripleo::network::midonet::agent':
120 zookeeper_servers => $zookeeper_node_ips,
121 cassandra_seeds => $cassandra_node_ips
124 elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2' {
126 include ::contrail::vrouter
127 # NOTE: it's not possible to use this class without a functional
128 # contrail controller up and running
129 #class {'::contrail::vrouter::provision_vrouter':
130 # require => Class['contrail::vrouter'],
135 include ::neutron::plugins::ml2
136 include ::neutron::agents::ml2::ovs
138 if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
139 class { '::neutron::agents::n1kv_vem':
140 n1kv_source => hiera('n1kv_vem_source', undef),
141 n1kv_version => hiera('n1kv_vem_version', undef),
145 if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
146 include ::neutron::agents::bigswitch
151 'DEFAULT/host': value => $fqdn;
155 include ::ceilometer::config
156 include ::ceilometer::agent::compute
157 include ::ceilometer::agent::auth
159 $snmpd_user = hiera('snmpd_readonly_user_name')
160 snmp::snmpv3_user { $snmpd_user:
162 authpass => hiera('snmpd_readonly_user_password'),
165 agentaddress => ['udp:161','udp6:[::1]:161'],
166 snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
169 hiera_include('compute_classes')
170 package_manifest{'/var/lib/tripleo/installed-packages/overcloud_compute': ensure => present}