Make puppet manifests compliant with Puppet 4.x
- https://docs.puppetlabs.com/puppet/3.8/reference/deprecated_language.html - Temporary disablement of the pupppet-lint autoload layout check failing for ringbuilder.pp. A fix for that will be part of an other patch. Change-Id: I495825641ab12e7c5789c1405649c356c5bb8051 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
parent
0d6b04c21a
commit
b9aab09518
1
Rakefile
1
Rakefile
@ -3,3 +3,4 @@ require 'puppet-lint/tasks/puppet-lint'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_autoloader_layout')
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
create_resources(sysctl::value, hiera('sysctl_settings'), {})
|
||||
|
||||
@ -25,13 +25,13 @@ if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
|
||||
exec { 'set selinux to permissive on boot':
|
||||
command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
|
||||
onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
|
||||
path => ["/usr/bin", "/usr/sbin"],
|
||||
path => ['/usr/bin', '/usr/sbin'],
|
||||
}
|
||||
|
||||
exec { 'set selinux to permissive':
|
||||
command => "setenforce 0",
|
||||
command => 'setenforce 0',
|
||||
onlyif => "which setenforce && getenforce | grep -i 'enforcing'",
|
||||
path => ["/usr/bin", "/usr/sbin"],
|
||||
path => ['/usr/bin', '/usr/sbin'],
|
||||
} -> Class['ceph::profile::osd']
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
create_resources(sysctl::value, hiera('sysctl_settings'), {})
|
||||
|
||||
@ -24,14 +24,14 @@ if count(hiera('ntp::servers')) > 0 {
|
||||
file { ['/etc/libvirt/qemu/networks/autostart/default.xml',
|
||||
'/etc/libvirt/qemu/networks/default.xml']:
|
||||
ensure => absent,
|
||||
before => Service['libvirt']
|
||||
before => Service['libvirt'],
|
||||
}
|
||||
# in case libvirt has been already running before the Puppet run, make
|
||||
# sure the default network is destroyed
|
||||
exec { 'libvirt-default-net-destroy':
|
||||
command => '/usr/bin/virsh net-destroy default',
|
||||
onlyif => '/usr/bin/virsh net-info default | /bin/grep -i "^active:\s*yes"',
|
||||
before => Service['libvirt'],
|
||||
onlyif => '/usr/bin/virsh net-info default | /bin/grep -i "^active:\s*yes"',
|
||||
before => Service['libvirt'],
|
||||
}
|
||||
|
||||
include ::nova
|
||||
@ -55,10 +55,10 @@ if $rbd_ephemeral_storage or $rbd_persistent_storage {
|
||||
}
|
||||
|
||||
if hiera('cinder_enable_nfs_backend', false) {
|
||||
if ($::selinux != "false") {
|
||||
if str2bool($::selinux) {
|
||||
selboolean { 'virt_use_nfs':
|
||||
value => on,
|
||||
persistent => true,
|
||||
value => on,
|
||||
persistent => true,
|
||||
} -> Package['nfs-utils']
|
||||
}
|
||||
|
||||
@ -69,20 +69,20 @@ include ::nova::compute::libvirt
|
||||
include ::nova::network::neutron
|
||||
include ::neutron
|
||||
|
||||
class { 'neutron::plugins::ml2':
|
||||
class { '::neutron::plugins::ml2':
|
||||
flat_networks => split(hiera('neutron_flat_networks'), ','),
|
||||
tenant_network_types => [hiera('neutron_tenant_network_type')],
|
||||
}
|
||||
|
||||
class { 'neutron::agents::ml2::ovs':
|
||||
class { '::neutron::agents::ml2::ovs':
|
||||
bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
|
||||
tunnel_types => split(hiera('neutron_tunnel_types'), ','),
|
||||
}
|
||||
|
||||
if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
|
||||
class { 'neutron::agents::n1kv_vem':
|
||||
n1kv_source => hiera('n1kv_vem_source', undef),
|
||||
n1kv_version => hiera('n1kv_vem_version', undef),
|
||||
class { '::neutron::agents::n1kv_vem':
|
||||
n1kv_source => hiera('n1kv_vem_source', undef),
|
||||
n1kv_version => hiera('n1kv_vem_version', undef),
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ snmp::snmpv3_user { $snmpd_user:
|
||||
authtype => 'MD5',
|
||||
authpass => hiera('snmpd_readonly_user_password'),
|
||||
}
|
||||
class { 'snmp':
|
||||
class { '::snmp':
|
||||
agentaddress => ['udp:161','udp6:[::1]:161'],
|
||||
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' ],
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
if hiera('step') >= 1 {
|
||||
|
||||
@ -70,18 +70,18 @@ if hiera('step') >= 2 {
|
||||
include ::tripleo::redis_notification
|
||||
}
|
||||
|
||||
if str2bool(hiera('enable_galera', 'true')) {
|
||||
if str2bool(hiera('enable_galera', true)) {
|
||||
$mysql_config_file = '/etc/my.cnf.d/galera.cnf'
|
||||
} else {
|
||||
$mysql_config_file = '/etc/my.cnf.d/server.cnf'
|
||||
}
|
||||
# TODO Galara
|
||||
class { 'mysql::server':
|
||||
config_file => $mysql_config_file,
|
||||
override_options => {
|
||||
class { '::mysql::server':
|
||||
config_file => $mysql_config_file,
|
||||
override_options => {
|
||||
'mysqld' => {
|
||||
'bind-address' => hiera('mysql_bind_host'),
|
||||
'max_connections' => hiera('mysql_max_connections'),
|
||||
'bind-address' => hiera('mysql_bind_host'),
|
||||
'max_connections' => hiera('mysql_max_connections'),
|
||||
'open_files_limit' => '-1',
|
||||
},
|
||||
},
|
||||
@ -126,31 +126,31 @@ if hiera('step') >= 2 {
|
||||
$enable_ceph = hiera('ceph_storage_count', 0) > 0
|
||||
|
||||
if $enable_ceph {
|
||||
class { 'ceph::profile::params':
|
||||
mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
|
||||
class { '::ceph::profile::params':
|
||||
mon_initial_members => downcase(hiera('ceph_mon_initial_members')),
|
||||
}
|
||||
include ::ceph::profile::mon
|
||||
}
|
||||
|
||||
if str2bool(hiera('enable_ceph_storage', 'false')) {
|
||||
if str2bool(hiera('enable_ceph_storage', false)) {
|
||||
if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
|
||||
exec { 'set selinux to permissive on boot':
|
||||
command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
|
||||
onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
|
||||
path => ["/usr/bin", "/usr/sbin"],
|
||||
path => ['/usr/bin', '/usr/sbin'],
|
||||
}
|
||||
|
||||
exec { 'set selinux to permissive':
|
||||
command => "setenforce 0",
|
||||
command => 'setenforce 0',
|
||||
onlyif => "which setenforce && getenforce | grep -i 'enforcing'",
|
||||
path => ["/usr/bin", "/usr/sbin"],
|
||||
path => ['/usr/bin', '/usr/sbin'],
|
||||
} -> Class['ceph::profile::osd']
|
||||
}
|
||||
|
||||
include ::ceph::profile::osd
|
||||
}
|
||||
|
||||
if str2bool(hiera('enable_external_ceph', 'false')) {
|
||||
if str2bool(hiera('enable_external_ceph', false)) {
|
||||
include ::ceph::profile::client
|
||||
}
|
||||
|
||||
@ -196,9 +196,9 @@ if hiera('step') >= 3 {
|
||||
|
||||
$glance_backend = downcase(hiera('glance_backend', 'swift'))
|
||||
case $glance_backend {
|
||||
swift: { $backend_store = 'glance.store.swift.Store' }
|
||||
file: { $backend_store = 'glance.store.filesystem.Store' }
|
||||
rbd: { $backend_store = 'glance.store.rbd.Store' }
|
||||
'swift': { $backend_store = 'glance.store.swift.Store' }
|
||||
'file': { $backend_store = 'glance.store.filesystem.Store' }
|
||||
'rbd': { $backend_store = 'glance.store.rbd.Store' }
|
||||
default: { fail('Unrecognized glance_backend parameter.') }
|
||||
}
|
||||
$http_store = ['glance.store.http.Store']
|
||||
@ -206,8 +206,8 @@ if hiera('step') >= 3 {
|
||||
|
||||
# TODO: notifications, scrubber, etc.
|
||||
include ::glance
|
||||
class { 'glance::api':
|
||||
known_stores => $glance_store
|
||||
class { '::glance::api':
|
||||
known_stores => $glance_store,
|
||||
}
|
||||
include ::glance::registry
|
||||
include join(['::glance::backend::', $glance_backend])
|
||||
@ -239,24 +239,24 @@ if hiera('step') >= 3 {
|
||||
require => Package['neutron'],
|
||||
}
|
||||
|
||||
class { 'neutron::plugins::ml2':
|
||||
flat_networks => split(hiera('neutron_flat_networks'), ','),
|
||||
class { '::neutron::plugins::ml2':
|
||||
flat_networks => split(hiera('neutron_flat_networks'), ','),
|
||||
tenant_network_types => [hiera('neutron_tenant_network_type')],
|
||||
mechanism_drivers => [hiera('neutron_mechanism_drivers')],
|
||||
mechanism_drivers => [hiera('neutron_mechanism_drivers')],
|
||||
}
|
||||
class { 'neutron::agents::ml2::ovs':
|
||||
class { '::neutron::agents::ml2::ovs':
|
||||
bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
|
||||
tunnel_types => split(hiera('neutron_tunnel_types'), ','),
|
||||
tunnel_types => split(hiera('neutron_tunnel_types'), ','),
|
||||
}
|
||||
if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
|
||||
include neutron::plugins::ml2::cisco::nexus1000v
|
||||
include ::neutron::plugins::ml2::cisco::nexus1000v
|
||||
|
||||
class { 'neutron::agents::n1kv_vem':
|
||||
n1kv_source => hiera('n1kv_vem_source', undef),
|
||||
n1kv_version => hiera('n1kv_vem_version', undef),
|
||||
class { '::neutron::agents::n1kv_vem':
|
||||
n1kv_source => hiera('n1kv_vem_source', undef),
|
||||
n1kv_version => hiera('n1kv_vem_version', undef),
|
||||
}
|
||||
|
||||
class { 'n1k_vsm':
|
||||
class { '::n1k_vsm':
|
||||
n1kv_source => hiera('n1kv_vsm_source', undef),
|
||||
n1kv_version => hiera('n1kv_vsm_version', undef),
|
||||
pacemaker_control => false,
|
||||
@ -272,7 +272,7 @@ if hiera('step') >= 3 {
|
||||
}
|
||||
|
||||
if hiera('neutron_enable_bigswitch_ml2', false) {
|
||||
include neutron::plugins::ml2::bigswitch::restproxy
|
||||
include ::neutron::plugins::ml2::bigswitch::restproxy
|
||||
}
|
||||
neutron_l3_agent_config {
|
||||
'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
|
||||
@ -291,7 +291,7 @@ if hiera('step') >= 3 {
|
||||
include ::cinder::glance
|
||||
include ::cinder::scheduler
|
||||
include ::cinder::volume
|
||||
class {'cinder::setup_test_volume':
|
||||
class { '::cinder::setup_test_volume':
|
||||
size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
|
||||
}
|
||||
|
||||
@ -371,18 +371,18 @@ if hiera('step') >= 3 {
|
||||
if hiera('cinder_enable_nfs_backend', false) {
|
||||
$cinder_nfs_backend = 'tripleo_nfs'
|
||||
|
||||
if ($::selinux != "false") {
|
||||
if str2bool($::selinux) {
|
||||
selboolean { 'virt_use_nfs':
|
||||
value => on,
|
||||
persistent => true,
|
||||
value => on,
|
||||
persistent => true,
|
||||
} -> Package['nfs-utils']
|
||||
}
|
||||
|
||||
package {'nfs-utils': } ->
|
||||
cinder::backend::nfs { $cinder_nfs_backend :
|
||||
nfs_servers => hiera('cinder_nfs_servers'),
|
||||
nfs_mount_options => hiera('cinder_nfs_mount_options'),
|
||||
nfs_shares_config => '/etc/cinder/shares-nfs.conf',
|
||||
nfs_servers => hiera('cinder_nfs_servers'),
|
||||
nfs_mount_options => hiera('cinder_nfs_mount_options'),
|
||||
nfs_shares_config => '/etc/cinder/shares-nfs.conf',
|
||||
}
|
||||
}
|
||||
|
||||
@ -406,9 +406,9 @@ if hiera('step') >= 3 {
|
||||
include ::swift::proxy::formpost
|
||||
|
||||
# swift storage
|
||||
if str2bool(hiera('enable_swift_storage', 'true')) {
|
||||
class {'swift::storage::all':
|
||||
mount_check => str2bool(hiera('swift_mount_check'))
|
||||
if str2bool(hiera('enable_swift_storage', true)) {
|
||||
class { '::swift::storage::all':
|
||||
mount_check => str2bool(hiera('swift_mount_check')),
|
||||
}
|
||||
if(!defined(File['/srv/node'])) {
|
||||
file { '/srv/node':
|
||||
@ -442,7 +442,7 @@ if hiera('step') >= 3 {
|
||||
include ::ceilometer::alarm::evaluator
|
||||
include ::ceilometer::expirer
|
||||
include ::ceilometer::collector
|
||||
include ceilometer::agent::auth
|
||||
include ::ceilometer::agent::auth
|
||||
class { '::ceilometer::db' :
|
||||
database_connection => $ceilometer_database_connection,
|
||||
}
|
||||
@ -463,9 +463,10 @@ if hiera('step') >= 3 {
|
||||
$_profile_support = 'None'
|
||||
}
|
||||
$neutron_options = {'profile_support' => $_profile_support }
|
||||
class { 'horizon':
|
||||
cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
|
||||
neutron_options => $neutron_options,
|
||||
|
||||
class { '::horizon':
|
||||
cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
|
||||
neutron_options => $neutron_options,
|
||||
}
|
||||
|
||||
$snmpd_user = hiera('snmpd_readonly_user_name')
|
||||
@ -473,7 +474,7 @@ if hiera('step') >= 3 {
|
||||
authtype => 'MD5',
|
||||
authpass => hiera('snmpd_readonly_user_password'),
|
||||
}
|
||||
class { 'snmp':
|
||||
class { '::snmp':
|
||||
agentaddress => ['udp:161','udp6:[::1]:161'],
|
||||
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' ],
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
create_resources(sysctl::value, hiera('sysctl_settings'), {})
|
||||
|
||||
@ -22,8 +22,8 @@ if count(hiera('ntp::servers')) > 0 {
|
||||
}
|
||||
|
||||
include ::swift
|
||||
class {'swift::storage::all':
|
||||
mount_check => str2bool(hiera('swift_mount_check'))
|
||||
class { '::swift::storage::all':
|
||||
mount_check => str2bool(hiera('swift_mount_check')),
|
||||
}
|
||||
if(!defined(File['/srv/node'])) {
|
||||
file { '/srv/node':
|
||||
@ -43,7 +43,7 @@ snmp::snmpv3_user { $snmpd_user:
|
||||
authtype => 'MD5',
|
||||
authpass => hiera('snmpd_readonly_user_password'),
|
||||
}
|
||||
class { 'snmp':
|
||||
class { '::snmp':
|
||||
agentaddress => ['udp:161','udp6:[::1]:161'],
|
||||
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' ],
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
create_resources(sysctl::value, hiera('sysctl_settings'), {})
|
||||
|
||||
@ -47,7 +47,7 @@ snmp::snmpv3_user { $snmpd_user:
|
||||
authtype => 'MD5',
|
||||
authpass => hiera('snmpd_readonly_user_password'),
|
||||
}
|
||||
class { 'snmp':
|
||||
class { '::snmp':
|
||||
agentaddress => ['udp:161','udp6:[::1]:161'],
|
||||
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' ],
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
include tripleo::packages
|
||||
include ::tripleo::packages
|
||||
|
||||
define add_devices(
|
||||
$swift_zones = '1'
|
||||
@ -37,31 +37,33 @@ define add_devices(
|
||||
$base = regsubst($name,'^r1.*-(.*)$','\1')
|
||||
$object = regsubst($base, '%PORT%', '6000')
|
||||
ring_object_device { $object:
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
}
|
||||
$container = regsubst($base, '%PORT%', '6001')
|
||||
ring_container_device { $container:
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
}
|
||||
$account = regsubst($base, '%PORT%', '6002')
|
||||
ring_account_device { $account:
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
zone => '1',
|
||||
weight => 100,
|
||||
}
|
||||
}
|
||||
|
||||
class tripleo::ringbuilder (
|
||||
$swift_zones = '1',
|
||||
$devices = '',
|
||||
$build_ring = 'True',
|
||||
$build_ring = true,
|
||||
$part_power,
|
||||
$replicas,
|
||||
$min_part_hours,
|
||||
) {
|
||||
|
||||
if str2bool(downcase("$build_ring")) {
|
||||
validate_bool($build_ring)
|
||||
|
||||
if $build_ring {
|
||||
|
||||
$device_array = strip(split(rstrip($devices), ','))
|
||||
|
||||
@ -74,7 +76,7 @@ class tripleo::ringbuilder (
|
||||
|
||||
# add all other devices
|
||||
add_devices {$device_array:
|
||||
swift_zones => $swift_zones
|
||||
swift_zones => $swift_zones,
|
||||
} ->
|
||||
|
||||
# rebalance
|
||||
|
Loading…
Reference in New Issue
Block a user