From efd4d00ab4fe318bd01e8e047d8a9fe3ba740ad8 Mon Sep 17 00:00:00 2001 From: Kanzhe Jiang Date: Fri, 8 Jan 2016 17:17:26 -0800 Subject: [PATCH] format cleanup with puppet lint Change-Id: I2e3626ec01f76a6ce0873cc1595eadce27cedef6 --- .../puppet/manifests/ceph-config.pp | 23 --- .../puppet/manifests/common-repo.pp | 20 +- .../puppet/manifests/compute-config.pp | 4 +- .../puppet/manifests/network-config.pp | 2 +- .../puppet/manifests/openstack-cleanup.pp | 13 +- .../puppet/manifests/reconfigure-keystone.pp | 22 +-- .../puppet/manifests/reconfigure-neutron.pp | 6 +- .../manifests/restart-cluster-services.pp | 6 +- .../puppet/modules/bcf/manifests/init.pp | 10 +- .../modules/bcf/manifests/p_only/ceph.pp | 64 ------- .../modules/bcf/manifests/p_only/compute.pp | 114 ++++++------ .../modules/bcf/manifests/p_only/network.pp | 40 ++-- ...gure-neutron.pp => reconfigure_neutron.pp} | 75 ++++---- ...ervices.pp => restart_cluster_services.pp} | 4 +- .../puppet/modules/bcf/manifests/p_v/ceph.pp | 42 ++--- .../modules/bcf/manifests/p_v/compute.pp | 174 +++++++++--------- .../modules/bcf/manifests/p_v/controller.pp | 93 +++++----- deployment_tasks.yaml | 10 +- 18 files changed, 313 insertions(+), 409 deletions(-) delete mode 100755 deployment_scripts/puppet/manifests/ceph-config.pp mode change 100755 => 100644 deployment_scripts/puppet/manifests/compute-config.pp mode change 100755 => 100644 deployment_scripts/puppet/manifests/network-config.pp mode change 100755 => 100644 deployment_scripts/puppet/manifests/reconfigure-neutron.pp mode change 100755 => 100644 deployment_scripts/puppet/manifests/restart-cluster-services.pp delete mode 100644 deployment_scripts/puppet/modules/bcf/manifests/p_only/ceph.pp rename deployment_scripts/puppet/modules/bcf/manifests/p_only/{reconfigure-neutron.pp => reconfigure_neutron.pp} (83%) rename deployment_scripts/puppet/modules/bcf/manifests/p_only/{restart-cluster-services.pp => restart_cluster_services.pp} (92%) diff --git a/deployment_scripts/puppet/manifests/ceph-config.pp b/deployment_scripts/puppet/manifests/ceph-config.pp deleted file mode 100755 index b832f94..0000000 --- a/deployment_scripts/puppet/manifests/ceph-config.pp +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2015 BigSwitch Networks -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -notice('MODULAR: bigswitch compute-config') -include bcf::params -if $bcf::params::openstack::bcf_mode == 'P-Only' { - include bcf::p_only::ceph -} -else { - include bcf::p_v::ceph -} diff --git a/deployment_scripts/puppet/manifests/common-repo.pp b/deployment_scripts/puppet/manifests/common-repo.pp index 8266cc6..1ddcadc 100644 --- a/deployment_scripts/puppet/manifests/common-repo.pp +++ b/deployment_scripts/puppet/manifests/common-repo.pp @@ -16,17 +16,11 @@ notice('MODULAR: bigswitch common-repo.pp') -class bcf::common-repo { - - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" - - package { 'python-pip': - ensure => 'installed', - } - exec { 'bsnstacklib': - command => 'pip install "bsnstacklib<2015.2"', - path => "/usr/local/bin/:/usr/bin/:/bin", - require => Package['python-pip'] - } +package { 'python-pip': + ensure => 'installed', +} +exec { 'bsnstacklib': + command => 'pip install "bsnstacklib<2015.2"', + path => '/usr/local/bin/:/usr/bin/:/bin', + require => Package['python-pip'] } - diff --git a/deployment_scripts/puppet/manifests/compute-config.pp b/deployment_scripts/puppet/manifests/compute-config.pp old mode 100755 new mode 100644 index 623fb9e..c85d7ef --- a/deployment_scripts/puppet/manifests/compute-config.pp +++ b/deployment_scripts/puppet/manifests/compute-config.pp @@ -16,8 +16,8 @@ notice('MODULAR: bigswitch compute-config') include bcf::params if $bcf::params::openstack::bcf_mode == 'P-Only' { - include bcf::p_only::compute + include bcf::p_only::compute } else { - include bcf::p_v::compute + include bcf::p_v::compute } diff --git a/deployment_scripts/puppet/manifests/network-config.pp b/deployment_scripts/puppet/manifests/network-config.pp old mode 100755 new mode 100644 index fdb482d..8b6cdee --- a/deployment_scripts/puppet/manifests/network-config.pp +++ b/deployment_scripts/puppet/manifests/network-config.pp @@ -13,6 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. # -notice("MODULAR: bigswitch network-config") +notice('MODULAR: bigswitch network-config') include bcf::params include bcf::p_only::network diff --git a/deployment_scripts/puppet/manifests/openstack-cleanup.pp b/deployment_scripts/puppet/manifests/openstack-cleanup.pp index 714d5e4..fcbb61a 100644 --- a/deployment_scripts/puppet/manifests/openstack-cleanup.pp +++ b/deployment_scripts/puppet/manifests/openstack-cleanup.pp @@ -17,16 +17,15 @@ notice('MODULAR: bigswitch openstack-cleanup') file { '/etc/bigswitch': - ensure => 'directory', + ensure => 'directory', } file { '/etc/bigswitch/purge_all.sh': - source => 'puppet:///modules/bcf/purge_all.sh', - ensure => file, + ensure => file, + source => 'puppet:///modules/bcf/purge_all.sh', } exec { 'purge openstack neutron objects': - command => 'bash /etc/bigswitch/purge_all.sh', - path => "/usr/local/bin/:/usr/bin/:/bin", - require => File['/etc/bigswitch/purge_all.sh'] + command => 'bash /etc/bigswitch/purge_all.sh', + path => '/usr/local/bin/:/usr/bin/:/bin', + require => File['/etc/bigswitch/purge_all.sh'] } - diff --git a/deployment_scripts/puppet/manifests/reconfigure-keystone.pp b/deployment_scripts/puppet/manifests/reconfigure-keystone.pp index 7430e6b..c716bc6 100644 --- a/deployment_scripts/puppet/manifests/reconfigure-keystone.pp +++ b/deployment_scripts/puppet/manifests/reconfigure-keystone.pp @@ -13,20 +13,20 @@ # License for the specific language governing permissions and limitations # under the License. # -notice("MODULAR: bigswitch reconfigure-keystone") +notice('MODULAR: bigswitch reconfigure-keystone') # configure /etc/keystone/keystone.conf -ini_setting { "keystone.conf notification driver": - ensure => present, - path => '/etc/keystone/keystone.conf', - section => 'DEFAULT', - key_val_separator => '=', - setting => 'notification_driver', - value => 'messaging', - notify => Service['keystone'], +ini_setting { 'keystone.conf notification driver': + ensure => present, + path => '/etc/keystone/keystone.conf', + section => 'DEFAULT', + key_val_separator => '=', + setting => 'notification_driver', + value => 'messaging', + notify => Service['keystone'], } service { 'keystone': - ensure => running, - enable => true, + ensure => running, + enable => true, } diff --git a/deployment_scripts/puppet/manifests/reconfigure-neutron.pp b/deployment_scripts/puppet/manifests/reconfigure-neutron.pp old mode 100755 new mode 100644 index a39f19c..8de205c --- a/deployment_scripts/puppet/manifests/reconfigure-neutron.pp +++ b/deployment_scripts/puppet/manifests/reconfigure-neutron.pp @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. # -notice("MODULAR: bigswitch reconfigure-neutron") +notice('MODULAR: bigswitch reconfigure-neutron') include bcf::params if $bcf::params::openstack::bcf_mode == 'P-Only' { - include bcf::p_only::reconfigure-neutron + include bcf::p_only::reconfigure_neutron } else { - include bcf::p_v::reconfigure-neutron + include bcf::p_v::reconfigure_neutron } diff --git a/deployment_scripts/puppet/manifests/restart-cluster-services.pp b/deployment_scripts/puppet/manifests/restart-cluster-services.pp old mode 100755 new mode 100644 index 4f78008..72be2ca --- a/deployment_scripts/puppet/manifests/restart-cluster-services.pp +++ b/deployment_scripts/puppet/manifests/restart-cluster-services.pp @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. # -notice("MODULAR: bigswitch restart-cluster-services") +notice('MODULAR: bigswitch restart-cluster-services') include bcf::params if $bcf::params::openstack::bcf_mode == 'P-Only' { - include bcf::p_only::restart-cluster-services + include bcf::p_only::restart_cluster_services } else { - include bcf::p_v::restart-cluster-services + include bcf::p_v::restart_cluster_services } diff --git a/deployment_scripts/puppet/modules/bcf/manifests/init.pp b/deployment_scripts/puppet/modules/bcf/manifests/init.pp index 01078f1..18a5baa 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/init.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/init.pp @@ -15,9 +15,9 @@ # class bcf { - $bond_lacp = "bond-mode 4" - $sys_desc_lacp = "5c:16:c7:00:00:04" - $sys_desc_xor = "5c:16:c7:00:00:00" + $bond_lacp = 'bond-mode 4' + $sys_desc_lacp = '5c:16:c7:00:00:04' + $sys_desc_xor = '5c:16:c7:00:00:00' # Network configuration $network_scheme = hiera_hash('network_scheme', {}) @@ -26,10 +26,10 @@ class bcf { $phy_devs = get_network_role_property('neutron/private', 'phys_dev') $if_str = "$phy_devs" if $if_str =~ /^bond.*/ { - $ifaces = join($phy_devs, ",") + $ifaces = join($phy_devs, ',') $bond = true $s = "${phy_devs[0]}," - $r = split("abc$ifaces", $s) + $r = split("abc${ifaces}", $s) $itfs = $r[1] } else { diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_only/ceph.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_only/ceph.pp deleted file mode 100644 index 90ac7e5..0000000 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_only/ceph.pp +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2015 BigSwitch Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -class bcf::p_only::ceph { - - include bcf - include bcf::params - # all of the exec statements use this path - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" - - $ifcfg_bond0 = "/etc/network/interfaces.d/ifcfg-bond0" - if $bcf::bond { - # ensure bond-mode is 802.3ad - exec { "ensure ${bcf::bond_lacp} in $ifcfg_bond0": - command => "echo '${bcf::bond_lacp}' >> $ifcfg_bond0", - unless => "grep -qe '${bcf::bond_lacp}' -- $ifcfg_bond0", - path => "/bin:/usr/bin", - require => Exec["update bond-mode in $ifcfg_bond0"], - } - exec { "update bond-mode in $ifcfg_bond0": - command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' $ifcfg_bond0", - path => "/bin:/usr/bin" - } - $sys_desc = $bcf::sys_desc_lacp - } - else { - $sys_desc = $bcf::sys_desc_xor - } - - # lldp - file { "/bin/send_lldp": - ensure => file, - mode => 0777, - } - file { "/etc/init/send_lldp.conf": - ensure => file, - content => " -description \"BCF LLDP\" -start on runlevel [2345] -stop on runlevel [!2345] -respawn -script - exec /bin/send_lldp --system-desc $sys_desc --system-name $(uname -n) -i 10 --network_interface $bcf::itfs -end script -", - } - service { "send_lldp": - ensure => running, - enable => true, - require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], - } -} diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_only/compute.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_only/compute.pp index 57ef662..ccadf2f 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_only/compute.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_only/compute.pp @@ -17,42 +17,42 @@ class bcf::p_only::compute { include bcf include bcf::params - + # edit rc.local for cron job and default gw - file { "/etc/rc.local": - ensure => file, - mode => 0777, + file { '/etc/rc.local': + ensure => file, + mode => '0777', }-> - file_line { "remove clear default gw": - path => '/etc/rc.local', - ensure => absent, - line => "ip route del default", + file_line { 'remove clear default gw': + ensure => absent, + path => '/etc/rc.local', + line => 'ip route del default', }-> - file_line { "remove ip route add default": - path => '/etc/rc.local', - ensure => absent, - line => "ip route add default via ${bcf::gw}", + file_line { 'remove ip route add default': + ensure => absent, + path => '/etc/rc.local', + line => "ip route add default via ${bcf::gw}", }-> - file_line { "clear default gw": - path => '/etc/rc.local', - line => "ip route del default", + file_line { 'clear default gw': + path => '/etc/rc.local', + line => 'ip route del default', }-> - file_line { "add default gw": - path => '/etc/rc.local', - line => "ip route add default via ${bcf::gw}", + file_line { 'add default gw': + path => '/etc/rc.local', + line => "ip route add default via ${bcf::gw}", }-> - file_line { "add exit 0": - path => '/etc/rc.local', - line => "exit 0", + file_line { 'add exit 0': + path => '/etc/rc.local', + line => 'exit 0', } exec { 'set default gw': - command => "ip route del default; ip route add default via ${bcf::gw}", - path => "/usr/local/bin/:/usr/bin/:/bin:/sbin", + command => "ip route del default; ip route add default via ${bcf::gw}", + path => '/usr/local/bin/:/usr/bin/:/bin:/sbin', } # config /etc/neutron/neutron.conf - ini_setting { "neutron.conf report_interval": + ini_setting { 'neutron.conf report_interval': ensure => present, path => '/etc/neutron/neutron.conf', section => 'agent', @@ -61,7 +61,7 @@ class bcf::p_only::compute { value => '60', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "neutron.conf agent_down_time": + ini_setting { 'neutron.conf agent_down_time': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -70,7 +70,7 @@ class bcf::p_only::compute { value => '150', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "neutron.conf service_plugins": + ini_setting { 'neutron.conf service_plugins': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -79,7 +79,7 @@ class bcf::p_only::compute { value => 'router', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "neutron.conf dhcp_agents_per_network": + ini_setting { 'neutron.conf dhcp_agents_per_network': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -88,7 +88,7 @@ class bcf::p_only::compute { value => '1', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "neutron.conf notification driver": + ini_setting { 'neutron.conf notification driver': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -97,10 +97,10 @@ class bcf::p_only::compute { value => 'messaging', notify => Service['neutron-plugin-openvswitch-agent'], } - + # set the correct properties in ml2_conf.ini on compute as well # config /etc/neutron/plugins/ml2/ml2_conf.ini - ini_setting { "ml2 type dirvers": + ini_setting { 'ml2 type dirvers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -109,7 +109,7 @@ class bcf::p_only::compute { value => 'vlan', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 tenant network types": + ini_setting { 'ml2 tenant network types': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -118,7 +118,7 @@ class bcf::p_only::compute { value => 'vlan', notify => Service['neutron-plugin-openvswitch-agent'], } - + # change ml2 ownership file { '/etc/neutron/plugins/ml2': owner => neutron, @@ -126,48 +126,48 @@ class bcf::p_only::compute { recurse => true, notify => Service['neutron-plugin-openvswitch-agent'], } - + # ensure neutron-plugin-openvswitch-agent is running - file { "/etc/init/neutron-plugin-openvswitch-agent.conf": - ensure => file, - mode => 0644, + file { '/etc/init/neutron-plugin-openvswitch-agent.conf': + ensure => file, + mode => '0644', } service { 'neutron-plugin-openvswitch-agent': ensure => 'running', - enable => 'true', + enable => true, provider => 'upstart', - hasrestart => 'true', - hasstatus => 'true', + hasrestart => true, + hasstatus => true, subscribe => [File['/etc/init/neutron-plugin-openvswitch-agent.conf']], } - + file { '/etc/neutron/dnsmasq-neutron.conf': - ensure => file, - content => 'dhcp-option-force=26,1400', + ensure => file, + content => 'dhcp-option-force=26,1400', } - + service { 'nova-compute': - ensure => running, - enable => true, + ensure => running, + enable => true, } $public_ssl = hiera('public_ssl') $horizon_ssl = $public_ssl['horizon'] if $horizon_ssl { - $novnc_protocol = 'https' + $novnc_protocol = 'https' } else { - $novnc_protocol = 'http' + $novnc_protocol = 'http' } - + # update nova.conf for novncproxy_base_url - ini_setting { "nova novncproxy_base_url": - ensure => present, - path => '/etc/nova/nova.conf', - section => 'DEFAULT', - key_val_separator => '=', - setting => 'novncproxy_base_url', - value => "${novnc_protocol}://${bcf::public_vip}:6080/vnc_auto.html", - notify => Service['nova-compute'] + ini_setting { 'nova novncproxy_base_url': + ensure => present, + path => '/etc/nova/nova.conf', + section => 'DEFAULT', + key_val_separator => '=', + setting => 'novncproxy_base_url', + value => "${novnc_protocol}://${bcf::public_vip}:6080/vnc_auto.html", + notify => Service['nova-compute'] } -} +} diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_only/network.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_only/network.pp index 34cd8d4..54cefa7 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_only/network.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_only/network.pp @@ -17,42 +17,42 @@ class bcf::p_only::network { include bcf include bcf::params - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" - $sys_desc_lacp = "5c:16:c7:00:00:04" + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' + $sys_desc_lacp = '5c:16:c7:00:00:04' # lldp - $a = file('/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/python_scripts/send_lldp','/dev/null') + $a = file('/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/python_scripts/send_lldp', '/dev/null') if($a != '') { - file { "/bin/send_lldp": - content => $a, - ensure => file, - mode => 0777, - } + file { '/bin/send_lldp': + ensure => file, + content => $a, + mode => '0777', + } } - file { "/etc/init/send_lldp.conf": - ensure => file, - content => " + file { '/etc/init/send_lldp.conf': + ensure => file, + content => " description \"BCF LLDP\" start on runlevel [2345] stop on runlevel [!2345] respawn script - exec /bin/send_lldp --system-desc $sys_desc_lacp --system-name $(uname -n) -i 10 --network_interface $bcf::itfs + exec /bin/send_lldp --system-desc ${sys_desc_lacp} --system-name $(uname -n) -i 10 --network_interface ${bcf::itfs} end script ", } - service { "send_lldp": - ensure => running, - enable => true, - require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], + + service { 'send_lldp': + ensure => running, + enable => true, + require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], } # load bonding module file_line {'load bonding on boot': - path => '/etc/modules', - line => 'bonding', - match => '^bonding$', + path => '/etc/modules', + line => 'bonding', + match => '^bonding$', } } - diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure-neutron.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure_neutron.pp similarity index 83% rename from deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure-neutron.pp rename to deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure_neutron.pp index 72c2d97..080509f 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure-neutron.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_only/reconfigure_neutron.pp @@ -13,30 +13,31 @@ # License for the specific language governing permissions and limitations # under the License. # -class bcf::p_only::reconfigure-neutron { +class bcf::p_only::reconfigure_neutron { include bcf include bcf::params - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" + include bcf::params::openstack + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' package { 'python-pip': - ensure => 'installed', + ensure => 'installed', } exec { 'bsnstacklib': - command => 'pip install "bsnstacklib<2015.2"', - path => "/usr/local/bin/:/usr/bin/:/bin", - require => Package['python-pip'] + command => 'pip install "bsnstacklib<2015.2"', + path => '/usr/local/bin/:/usr/bin/:/bin', + require => Package['python-pip'] } # purge bcf controller public key exec { 'purge bcf key': - command => "rm -rf /etc/neutron/plugins/ml2/host_certs/*", + command => 'rm -rf /etc/neutron/plugins/ml2/host_certs/*', path => $binpath, notify => Service['neutron-server'], } # config /etc/neutron/neutron.conf - ini_setting { "neutron.conf report_interval": + ini_setting { 'neutron.conf report_interval': ensure => present, path => '/etc/neutron/neutron.conf', section => 'agent', @@ -45,7 +46,7 @@ class bcf::p_only::reconfigure-neutron { value => '60', notify => Service['neutron-server'], } - ini_setting { "neutron.conf agent_down_time": + ini_setting { 'neutron.conf agent_down_time': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -54,7 +55,7 @@ class bcf::p_only::reconfigure-neutron { value => '150', notify => Service['neutron-server'], } - ini_setting { "neutron.conf service_plugins": + ini_setting { 'neutron.conf service_plugins': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -63,7 +64,7 @@ class bcf::p_only::reconfigure-neutron { value => 'router', notify => Service['neutron-server'], } - ini_setting { "neutron.conf dhcp_agents_per_network": + ini_setting { 'neutron.conf dhcp_agents_per_network': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -72,7 +73,7 @@ class bcf::p_only::reconfigure-neutron { value => '1', notify => Service['neutron-server'], } - ini_setting { "neutron.conf network_scheduler_driver": + ini_setting { 'neutron.conf network_scheduler_driver': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -81,7 +82,7 @@ class bcf::p_only::reconfigure-neutron { value => 'neutron.scheduler.dhcp_agent_scheduler.WeightScheduler', notify => Service['neutron-server'], } - ini_setting { "neutron.conf notification driver": + ini_setting { 'neutron.conf notification driver': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -92,7 +93,7 @@ class bcf::p_only::reconfigure-neutron { } # config /etc/neutron/plugin.ini - ini_setting { "neutron plugin.ini firewall_driver": + ini_setting { 'neutron plugin.ini firewall_driver': ensure => present, path => '/etc/neutron/plugin.ini', section => 'securitygroup', @@ -101,7 +102,7 @@ class bcf::p_only::reconfigure-neutron { value => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', notify => Service['neutron-server'], } - ini_setting { "neutron plugin.ini enable_security_group": + ini_setting { 'neutron plugin.ini enable_security_group': ensure => present, path => '/etc/neutron/plugin.ini', section => 'securitygroup', @@ -111,12 +112,12 @@ class bcf::p_only::reconfigure-neutron { notify => Service['neutron-server'], } file { '/etc/neutron/dnsmasq-neutron.conf': - ensure => file, - content => 'dhcp-option-force=26,1400', + ensure => file, + content => 'dhcp-option-force=26,1400', } # config /etc/neutron/l3-agent.ini - ini_setting { "l3 agent disable metadata proxy": + ini_setting { 'l3 agent disable metadata proxy': ensure => present, path => '/etc/neutron/l3_agent.ini', section => 'DEFAULT', @@ -124,7 +125,7 @@ class bcf::p_only::reconfigure-neutron { setting => 'enable_metadata_proxy', value => 'False', } - ini_setting { "l3 agent external network bridge": + ini_setting { 'l3 agent external network bridge': ensure => present, path => '/etc/neutron/l3_agent.ini', section => 'DEFAULT', @@ -132,7 +133,7 @@ class bcf::p_only::reconfigure-neutron { setting => 'external_network_bridge', value => '', } - ini_setting { "l3 agent handle_internal_only_routers": + ini_setting { 'l3 agent handle_internal_only_routers': ensure => present, path => '/etc/neutron/l3_agent.ini', section => 'DEFAULT', @@ -142,7 +143,7 @@ class bcf::p_only::reconfigure-neutron { } # config /etc/neutron/plugins/ml2/ml2_conf.ini - ini_setting { "ml2 type dirvers": + ini_setting { 'ml2 type dirvers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -151,7 +152,7 @@ class bcf::p_only::reconfigure-neutron { value => 'vlan', notify => Service['neutron-server'], } - ini_setting { "ml2 tenant network types": + ini_setting { 'ml2 tenant network types': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -160,7 +161,7 @@ class bcf::p_only::reconfigure-neutron { value => 'vlan', notify => Service['neutron-server'], } - ini_setting { "ml2 mechanism drivers": + ini_setting { 'ml2 mechanism drivers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -169,7 +170,7 @@ class bcf::p_only::reconfigure-neutron { value => 'openvswitch,bsn_ml2', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy ssl cert directory": + ini_setting { 'ml2 restproxy ssl cert directory': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -178,14 +179,14 @@ class bcf::p_only::reconfigure-neutron { value => '/etc/neutron/plugins/ml2', notify => Service['neutron-server'], } - if $bcf::params::openstack::bcf_controller_2 == ":8000" { + if $bcf::params::openstack::bcf_controller_2 == ':8000' { $server = $bcf::params::openstack::bcf_controller_1 } else { $server = "${bcf::params::openstack::bcf_controller_1},${bcf::params::openstack::bcf_controller_2}" } - ini_setting { "ml2 restproxy servers": + ini_setting { 'ml2 restproxy servers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -194,7 +195,7 @@ class bcf::p_only::reconfigure-neutron { value => $server, notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy server auth": + ini_setting { 'ml2 restproxy server auth': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -203,7 +204,7 @@ class bcf::p_only::reconfigure-neutron { value => "${bcf::params::openstack::bcf_username}:${bcf::params::openstack::bcf_password}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy server ssl": + ini_setting { 'ml2 restproxy server ssl': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -212,7 +213,7 @@ class bcf::p_only::reconfigure-neutron { value => 'True', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auto sync on failure": + ini_setting { 'ml2 restproxy auto sync on failure': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -221,7 +222,7 @@ class bcf::p_only::reconfigure-neutron { value => 'True', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy consistency interval": + ini_setting { 'ml2 restproxy consistency interval': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -230,7 +231,7 @@ class bcf::p_only::reconfigure-neutron { value => 60, notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy neutron_id": + ini_setting { 'ml2 restproxy neutron_id': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -239,7 +240,7 @@ class bcf::p_only::reconfigure-neutron { value => "${bcf::params::openstack::bcf_instance_id}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_url": + ini_setting { 'ml2 restproxy auth_url': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -248,7 +249,7 @@ class bcf::p_only::reconfigure-neutron { value => "http://${bcf::params::openstack::keystone_vip}:35357", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_user": + ini_setting { 'ml2 restproxy auth_user': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -257,7 +258,7 @@ class bcf::p_only::reconfigure-neutron { value => "${bcf::params::openstack::auth_user}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_password": + ini_setting { 'ml2 restproxy auth_password': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -266,7 +267,7 @@ class bcf::p_only::reconfigure-neutron { value => "${bcf::params::openstack::auth_password}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_tenant_name": + ini_setting { 'ml2 restproxy auth_tenant_name': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -286,7 +287,7 @@ class bcf::p_only::reconfigure-neutron { # neutron-server, keystone service { 'neutron-server': - ensure => running, - enable => true, + ensure => running, + enable => true, } } diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_only/restart-cluster-services.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_only/restart_cluster_services.pp similarity index 92% rename from deployment_scripts/puppet/modules/bcf/manifests/p_only/restart-cluster-services.pp rename to deployment_scripts/puppet/modules/bcf/manifests/p_only/restart_cluster_services.pp index 0d4c398..5de0f71 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_only/restart-cluster-services.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_only/restart_cluster_services.pp @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. # -class bcf::p_only::restart-cluster-services { +class bcf::p_only::restart_cluster_services { include bcf include bcf::params - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' $nodes_hash = hiera('nodes', {}) $roles = node_roles($nodes_hash, hiera('uid')) diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_v/ceph.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_v/ceph.pp index 9737e3e..f40ed9e 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_v/ceph.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_v/ceph.pp @@ -18,33 +18,33 @@ class bcf::p_v::ceph { include bcf include bcf::params # all of the exec statements use this path - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' - $ifcfg_bond0 = "/etc/network/interfaces.d/ifcfg-bond0" + $ifcfg_bond0 = '/etc/network/interfaces.d/ifcfg-bond0' if $bcf::bond { - # ensure bond-mode is 802.3ad - exec { "ensure ${bcf::bond_lacp} in $ifcfg_bond0": - command => "echo '${bcf::bond_lacp}' >> $ifcfg_bond0", - unless => "grep -qe '${bcf::bond_lacp}' -- $ifcfg_bond0", - path => "/bin:/usr/bin", - require => Exec["update bond-mode in $ifcfg_bond0"], - } - exec { "update bond-mode in $ifcfg_bond0": - command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' $ifcfg_bond0", - path => "/bin:/usr/bin" - } - $sys_desc = $bcf::sys_desc_lacp + # ensure bond-mode is 802.3ad + exec { "ensure ${bcf::bond_lacp} in ${ifcfg_bond0}": + command => "echo '${bcf::bond_lacp}' >> ${ifcfg_bond0}", + unless => "grep -qe '${bcf::bond_lacp}' -- ${ifcfg_bond0}", + path => '/bin:/usr/bin', + require => Exec["update bond-mode in ${ifcfg_bond0}"], + } + exec { "update bond-mode in ${ifcfg_bond0}": + command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' ${ifcfg_bond0}", + path => '/bin:/usr/bin' + } + $sys_desc = $bcf::sys_desc_lacp } else { - $sys_desc = $bcf::sys_desc_xor + $sys_desc = $bcf::sys_desc_xor } # lldp - file { "/bin/send_lldp": - ensure => file, - mode => 0777, + file { '/bin/send_lldp': + ensure => file, + mode => '0777', } - file { "/etc/init/send_lldp.conf": + file { '/etc/init/send_lldp.conf': ensure => file, content => " description \"BCF LLDP\" @@ -52,11 +52,11 @@ start on runlevel [2345] stop on runlevel [!2345] respawn script - exec /bin/send_lldp --system-desc $sys_desc --system-name $(uname -n) -i 10 --network_interface $bcf::itfs + exec /bin/send_lldp --system-desc ${sys_desc} --system-name $(uname -n) -i 10 --network_interface ${bcf::itfs} end script ", } - service { "send_lldp": + service { 'send_lldp': ensure => running, enable => true, require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_v/compute.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_v/compute.pp index f67327e..30cc37b 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_v/compute.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_v/compute.pp @@ -18,95 +18,95 @@ class bcf::p_v::compute { include bcf include bcf::params # all of the exec statements use this path - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" - - $ifcfg_bond0 = "/etc/network/interfaces.d/ifcfg-bond0" - $sys_desc_lacp = "5c:16:c7:00:00:04" - $sys_desc_xor = "5c:16:c7:00:00:00" + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' + + $ifcfg_bond0 = '/etc/network/interfaces.d/ifcfg-bond0' + $sys_desc_lacp = '5c:16:c7:00:00:04' + $sys_desc_xor = '5c:16:c7:00:00:00' if $bcf::bond { - # ensure bond-mode is 802.3ad - exec { "ensure ${bcf::bond_lacp} in $ifcfg_bond0": - command => "echo '${bcf::bond_lacp}' >> $ifcfg_bond0", - unless => "grep -qe '${bcf::bond_lacp}' -- $ifcfg_bond0", - path => "/bin:/usr/bin", - require => Exec["update bond-mode in $ifcfg_bond0"], - } - exec { "update bond-mode in $ifcfg_bond0": - command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' $ifcfg_bond0", - path => "/bin:/usr/bin" - } - $sys_desc = $bcf::sys_desc_lacp + # ensure bond-mode is 802.3ad + exec { "ensure ${bcf::bond_lacp} in ${ifcfg_bond0}": + command => "echo '${bcf::bond_lacp}' >> ${ifcfg_bond0}", + unless => "grep -qe '${bcf::bond_lacp}' -- ${ifcfg_bond0}", + path => '/bin:/usr/bin', + require => Exec["update bond-mode in ${ifcfg_bond0}"], + } + exec { "update bond-mode in ${ifcfg_bond0}": + command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' ${ifcfg_bond0}", + path => '/bin:/usr/bin' + } + $sys_desc = $bcf::sys_desc_lacp } else { - $sys_desc = $bcf::sys_desc_xor + $sys_desc = $bcf::sys_desc_xor } # lldp $a = file('/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/python_scripts/send_lldp','/dev/null') if($a != '') { - file { "/bin/send_lldp": - content => $a, - ensure => file, - mode => 0777, - } + file { '/bin/send_lldp': + ensure => file, + content => $a, + mode => '0777', + } } - file { "/etc/init/send_lldp.conf": - ensure => file, - content => " + file { '/etc/init/send_lldp.conf': + ensure => file, + content => " description \"BCF LLDP\" start on runlevel [2345] stop on runlevel [!2345] respawn script - exec /bin/send_lldp --system-desc $sys_desc --system-name $(uname -n) -i 10 --network_interface $bcf::itfs + exec /bin/send_lldp --system-desc ${sys_desc} --system-name $(uname -n) -i 10 --network_interface ${bcf::itfs} end script ", } - service { "send_lldp": - ensure => running, - enable => true, - require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], + service { 'send_lldp': + ensure => running, + enable => true, + require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']], } - + # edit rc.local for cron job and default gw - file { "/etc/rc.local": - ensure => file, - mode => 0777, + file { '/etc/rc.local': + ensure => file, + mode => '0777', }-> - file_line { "remove clear default gw": - path => '/etc/rc.local', - ensure => absent, - line => "ip route del default", + file_line { 'remove clear default gw': + ensure => absent, + path => '/etc/rc.local', + line => 'ip route del default', }-> - file_line { "remove ip route add default": - path => '/etc/rc.local', - ensure => absent, - line => "ip route add default via ${bcf::gw}", + file_line { 'remove ip route add default': + ensure => absent, + path => '/etc/rc.local', + line => "ip route add default via ${bcf::gw}", }-> - file_line { "clear default gw": - path => '/etc/rc.local', - line => "ip route del default", + file_line { 'clear default gw': + path => '/etc/rc.local', + line => 'ip route del default', }-> - file_line { "add default gw": - path => '/etc/rc.local', - line => "ip route add default via ${bcf::gw}", + file_line { 'add default gw': + path => '/etc/rc.local', + line => "ip route add default via ${bcf::gw}", }-> - file_line { "add exit 0": - path => '/etc/rc.local', - line => "exit 0", + file_line { 'add exit 0': + path => '/etc/rc.local', + line => 'exit 0', } # config /etc/neutron/neutron.conf - ini_setting { "neutron.conf report_interval": + ini_setting { 'neutron.conf report_interval': ensure => present, path => '/etc/neutron/neutron.conf', section => 'agent', key_val_separator => '=', setting => 'report_interval', - value => '60', + value => 60, } - ini_setting { "neutron.conf agent_down_time": + ini_setting { 'neutron.conf agent_down_time': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -114,7 +114,7 @@ end script setting => 'agent_down_time', value => '150', } - ini_setting { "neutron.conf service_plugins": + ini_setting { 'neutron.conf service_plugins': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -122,7 +122,7 @@ end script setting => 'service_plugins', value => 'router', } - ini_setting { "neutron.conf dhcp_agents_per_network": + ini_setting { 'neutron.conf dhcp_agents_per_network': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -130,7 +130,7 @@ end script setting => 'dhcp_agents_per_network', value => '1', } - ini_setting { "neutron.conf notification driver": + ini_setting { 'neutron.conf notification driver': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -138,10 +138,10 @@ end script setting => 'notification_driver', value => 'messaging', } - + # set the correct properties in ml2_conf.ini on compute as well # config /etc/neutron/plugins/ml2/ml2_conf.ini - ini_setting { "ml2 type dirvers": + ini_setting { 'ml2 type dirvers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -150,7 +150,7 @@ end script value => 'vlan', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 tenant network types": + ini_setting { 'ml2 tenant network types': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -159,7 +159,7 @@ end script value => 'vlan', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 mechanism drivers": + ini_setting { 'ml2 mechanism drivers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -168,7 +168,7 @@ end script value => 'openvswitch,bsn_ml2', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy ssl cert directory": + ini_setting { 'ml2 restproxy ssl cert directory': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -177,7 +177,7 @@ end script value => '/etc/neutron/plugins/ml2', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy servers": + ini_setting { 'ml2 restproxy servers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -186,7 +186,7 @@ end script value => "${bcf::params::openstack::bcf_controller_1},${bcf::params::openstack::bcf_controller_2}", notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy server auth": + ini_setting { 'ml2 restproxy server auth': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -195,7 +195,7 @@ end script value => "${bcf::params::openstack::bcf_username}:${bcf::params::openstack::bcf_password}", notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy server ssl": + ini_setting { 'ml2 restproxy server ssl': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -204,7 +204,7 @@ end script value => 'True', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy auto sync on failure": + ini_setting { 'ml2 restproxy auto sync on failure': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -213,7 +213,7 @@ end script value => 'True', notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy consistency interval": + ini_setting { 'ml2 restproxy consistency interval': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -222,7 +222,7 @@ end script value => 60, notify => Service['neutron-plugin-openvswitch-agent'], } - ini_setting { "ml2 restproxy neutron_id": + ini_setting { 'ml2 restproxy neutron_id': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -231,7 +231,7 @@ end script value => "${bcf::params::openstack::bcf_instance_id}", notify => Service['neutron-plugin-openvswitch-agent'], } - + # change ml2 ownership file { '/etc/neutron/plugins/ml2': owner => neutron, @@ -239,28 +239,28 @@ end script recurse => true, notify => Service['neutron-plugin-openvswitch-agent'], } - + # ensure neutron-plugin-openvswitch-agent is running - file { "/etc/init/neutron-plugin-openvswitch-agent.conf": - ensure => file, - mode => 0644, + file { '/etc/init/neutron-plugin-openvswitch-agent.conf': + ensure => file, + mode => '0644', } service { 'neutron-plugin-openvswitch-agent': ensure => 'running', - enable => 'true', + enable => true, provider => 'upstart', - hasrestart => 'true', - hasstatus => 'true', + hasrestart => true, + hasstatus => true, subscribe => [File['/etc/init/neutron-plugin-openvswitch-agent.conf']], } - + file { '/etc/neutron/dnsmasq-neutron.conf': - ensure => file, - content => 'dhcp-option-force=26,1400', + ensure => file, + content => 'dhcp-option-force=26,1400', } - + # dhcp configuration - ini_setting { "dhcp agent interface driver": + ini_setting { 'dhcp agent interface driver': ensure => present, path => '/etc/neutron/dhcp_agent.ini', section => 'DEFAULT', @@ -268,7 +268,7 @@ end script setting => 'interface_driver', value => 'neutron.agent.linux.interface.OVSInterfaceDriver', } - ini_setting { "dhcp agent dhcp driver": + ini_setting { 'dhcp agent dhcp driver': ensure => present, path => '/etc/neutron/dhcp_agent.ini', section => 'DEFAULT', @@ -276,7 +276,7 @@ end script setting => 'dhcp_driver', value => 'neutron.agent.linux.dhcp.Dnsmasq', } - ini_setting { "dhcp agent enable isolated metadata": + ini_setting { 'dhcp agent enable isolated metadata': ensure => present, path => '/etc/neutron/dhcp_agent.ini', section => 'DEFAULT', @@ -284,7 +284,7 @@ end script setting => 'enable_isolated_metadata', value => 'True', } - ini_setting { "dhcp agent disable metadata network": + ini_setting { 'dhcp agent disable metadata network': ensure => present, path => '/etc/neutron/dhcp_agent.ini', section => 'DEFAULT', @@ -292,7 +292,7 @@ end script setting => 'enable_metadata_network', value => 'False', } - ini_setting { "dhcp agent disable dhcp_delete_namespaces": + ini_setting { 'dhcp agent disable dhcp_delete_namespaces': ensure => present, path => '/etc/neutron/dhcp_agent.ini', section => 'DEFAULT', @@ -300,4 +300,4 @@ end script setting => 'dhcp_delete_namespaces', value => 'False', } -} +} diff --git a/deployment_scripts/puppet/modules/bcf/manifests/p_v/controller.pp b/deployment_scripts/puppet/modules/bcf/manifests/p_v/controller.pp index 5a75a0b..6d24551 100644 --- a/deployment_scripts/puppet/modules/bcf/manifests/p_v/controller.pp +++ b/deployment_scripts/puppet/modules/bcf/manifests/p_v/controller.pp @@ -16,40 +16,38 @@ class bcf::p_v::controller { include bcf::params - $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" + $binpath = '/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin' package { 'python-pip': ensure => 'installed', } exec { 'bsnstacklib': command => 'pip install "bsnstacklib<2015.2"', - path => "/usr/local/bin/:/usr/bin/:/bin", + path => '/usr/local/bin/:/usr/bin/:/bin', require => Package['python-pip'] } # uplink mtu - define uplink_mtu { - file_line { "ifconfig $name mtu ${bcf::params::openstack::mtu}": - path => '/etc/rc.local', - line => "ifconfig $name mtu ${bcf::params::openstack::mtu}", - match => "^ifconfig $name mtu ${bcf::params::openstack::mtu}", - } + file_line { "ifconfig ${name} mtu ${bcf::params::openstack::mtu}": + path => '/etc/rc.local', + line => "ifconfig ${name} mtu ${bcf::params::openstack::mtu}", + match => "^ifconfig ${name} mtu ${bcf::params::openstack::mtu}", } # make sure known_hosts is cleaned up - file { "/root/.ssh/known_hosts": + file { '/root/.ssh/known_hosts': ensure => absent, } # purge bcf controller public key exec { 'purge bcf key': - command => "rm -rf /etc/neutron/plugins/ml2/host_certs/*", + command => 'rm -rf /etc/neutron/plugins/ml2/host_certs/*', path => $binpath, notify => Service['neutron-server'], } # config /etc/neutron/neutron.conf - ini_setting { "neutron.conf report_interval": + ini_setting { 'neutron.conf report_interval': ensure => present, path => '/etc/neutron/neutron.conf', section => 'agent', @@ -57,7 +55,7 @@ class bcf::p_v::controller { setting => 'report_interval', value => '60', } - ini_setting { "neutron.conf agent_down_time": + ini_setting { 'neutron.conf agent_down_time': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -65,7 +63,7 @@ class bcf::p_v::controller { setting => 'agent_down_time', value => '150', } - ini_setting { "neutron.conf service_plugins": + ini_setting { 'neutron.conf service_plugins': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -74,7 +72,7 @@ class bcf::p_v::controller { value => 'router', notify => Service['neutron-server'], } - ini_setting { "neutron.conf dhcp_agents_per_network": + ini_setting { 'neutron.conf dhcp_agents_per_network': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -83,7 +81,7 @@ class bcf::p_v::controller { value => '1', notify => Service['neutron-server'], } - ini_setting { "neutron.conf notification driver": + ini_setting { 'neutron.conf notification driver': ensure => present, path => '/etc/neutron/neutron.conf', section => 'DEFAULT', @@ -94,7 +92,7 @@ class bcf::p_v::controller { } # configure /etc/keystone/keystone.conf - ini_setting { "keystone.conf notification driver": + ini_setting { 'keystone.conf notification driver': ensure => present, path => '/etc/keystone/keystone.conf', section => 'DEFAULT', @@ -105,7 +103,7 @@ class bcf::p_v::controller { } # config /etc/neutron/plugin.ini - ini_setting { "neutron plugin.ini firewall_driver": + ini_setting { 'neutron plugin.ini firewall_driver': ensure => present, path => '/etc/neutron/plugin.ini', section => 'securitygroup', @@ -114,7 +112,7 @@ class bcf::p_v::controller { value => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', notify => Service['neutron-server'], } - ini_setting { "neutron plugin.ini enable_security_group": + ini_setting { 'neutron plugin.ini enable_security_group': ensure => present, path => '/etc/neutron/plugin.ini', section => 'securitygroup', @@ -124,12 +122,12 @@ class bcf::p_v::controller { notify => Service['neutron-server'], } file { '/etc/neutron/dnsmasq-neutron.conf': - ensure => file, - content => 'dhcp-option-force=26,1400', + ensure => file, + content => 'dhcp-option-force=26,1400', } # config /etc/neutron/l3-agent.ini - ini_setting { "l3 agent disable metadata proxy": + ini_setting { 'l3 agent disable metadata proxy': ensure => present, path => '/etc/neutron/l3_agent.ini', section => 'DEFAULT', @@ -137,7 +135,7 @@ class bcf::p_v::controller { setting => 'enable_metadata_proxy', value => 'False', } - ini_setting { "l3 agent external network bridge": + ini_setting { 'l3 agent external network bridge': ensure => present, path => '/etc/neutron/l3_agent.ini', section => 'DEFAULT', @@ -147,7 +145,7 @@ class bcf::p_v::controller { } # config /etc/neutron/plugins/ml2/ml2_conf.ini - ini_setting { "ml2 type dirvers": + ini_setting { 'ml2 type dirvers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -156,7 +154,7 @@ class bcf::p_v::controller { value => 'vlan', notify => Service['neutron-server'], } - ini_setting { "ml2 tenant network types": + ini_setting { 'ml2 tenant network types': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -165,7 +163,7 @@ class bcf::p_v::controller { value => 'vlan', notify => Service['neutron-server'], } - ini_setting { "ml2 mechanism drivers": + ini_setting { 'ml2 mechanism drivers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'ml2', @@ -174,7 +172,7 @@ class bcf::p_v::controller { value => 'openvswitch,bsn_ml2', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy ssl cert directory": + ini_setting { 'ml2 restproxy ssl cert directory': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -183,14 +181,14 @@ class bcf::p_v::controller { value => '/etc/neutron/plugins/ml2', notify => Service['neutron-server'], } - if $bcf::params::openstack::bcf_controller_2 == "" { + if $bcf::params::openstack::bcf_controller_2 == ''{ $server = $bcf::params::openstack::bcf_controller_1 } else { $server = "${bcf::params::openstack::bcf_controller_1},${bcf::params::openstack::bcf_controller_2}" } - ini_setting { "ml2 restproxy servers": + ini_setting { 'ml2 restproxy servers': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -199,7 +197,7 @@ class bcf::p_v::controller { value => $server, notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy server auth": + ini_setting { 'ml2 restproxy server auth': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -208,7 +206,7 @@ class bcf::p_v::controller { value => "${bcf::params::openstack::bcf_username}:${bcf::params::openstack::bcf_password}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy server ssl": + ini_setting { 'ml2 restproxy server ssl': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -217,7 +215,7 @@ class bcf::p_v::controller { value => 'True', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auto sync on failure": + ini_setting { 'ml2 restproxy auto sync on failure': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -226,7 +224,7 @@ class bcf::p_v::controller { value => 'True', notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy consistency interval": + ini_setting { 'ml2 restproxy consistency interval': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -235,7 +233,7 @@ class bcf::p_v::controller { value => 60, notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy neutron_id": + ini_setting { 'ml2 restproxy neutron_id': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -244,7 +242,7 @@ class bcf::p_v::controller { value => "${bcf::params::openstack::bcf_instance_id}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_url": + ini_setting { 'ml2 restproxy auth_url': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -253,7 +251,7 @@ class bcf::p_v::controller { value => "http://${bcf::params::openstack::keystone_vip}:35357", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_user": + ini_setting { 'ml2 restproxy auth_user': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -262,7 +260,7 @@ class bcf::p_v::controller { value => "${bcf::params::openstack::auth_user}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_password": + ini_setting { 'ml2 restproxy auth_password': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -271,7 +269,7 @@ class bcf::p_v::controller { value => "${bcf::params::openstack::auth_password}", notify => Service['neutron-server'], } - ini_setting { "ml2 restproxy auth_tenant_name": + ini_setting { 'ml2 restproxy auth_tenant_name': ensure => present, path => '/etc/neutron/plugins/ml2/ml2_conf.ini', section => 'restproxy', @@ -291,24 +289,23 @@ class bcf::p_v::controller { # heat-engine, neutron-server, neutron-dhcp-agent and neutron-metadata-agent service { 'heat-engine': - ensure => running, - enable => true, + ensure => running, + enable => true, } service { 'neutron-server': - ensure => running, - enable => true, + ensure => running, + enable => true, } service { 'keystone': - ensure => running, - enable => true, + ensure => running, + enable => true, } service { 'neutron-dhcp-agent': - ensure => stopped, - enable => false, + ensure => stopped, + enable => false, } service { 'neutron-metadata-agent': - ensure => stopped, - enable => false, + ensure => stopped, + enable => false, } } - diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 5030e0d..20c9ef5 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -23,12 +23,12 @@ type: puppet role: [primary-controller, controller] required_for: [post_deployment_end] - requires: [controller-cleanup] + requires: [openstack-cleanup] parameters: puppet_manifest: puppet/manifests/reconfigure-keystone.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 720 -- id: reconfigure-controller-neutron +- id: reconfigure-neutron type: puppet role: [controller] required_for: [post_deployment_end] @@ -41,12 +41,12 @@ type: puppet role: [primary-controller] required_for: [post_deployment_end] - requires: [reconfigure-controller-neutron] + requires: [reconfigure-neutron] parameters: puppet_manifest: puppet/manifests/reconfigure-neutron.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 720 -- id: openstack-restart-cluster-services +- id: restart-cluster-services type: puppet role: [primary-controller] required_for: [post_deployment_end] @@ -59,7 +59,7 @@ type: puppet role: [compute] required_for: [post_deployment_end] - requires: [openstack-restart-cluster-services] + requires: [restart-cluster-services] parameters: puppet_manifest: puppet/manifests/compute-config.pp puppet_modules: puppet/modules:/etc/puppet/modules