Various Puppet lint fixes
* Fixes following warnings: * double quoted string containing no variables * string containing only a variable * variable not enclosed in {} * indentation of => is not properly aligned * Fix following error: * two-space soft tabs not used * Remove some comments from the code, they added no value. Change-Id: I3165e65e95c3565951077786d2edf77245460c35
This commit is contained in:
parent
6b7d92551e
commit
d3bc94f168
@ -1,8 +1,4 @@
|
|||||||
#
|
#
|
||||||
# parameters that may need to be added
|
|
||||||
# $state_path = /opt/stack/data/cinder
|
|
||||||
# $osapi_volume_extension = cinder.api.openstack.volume.contrib.standard_extensions
|
|
||||||
# $root_helper = sudo /usr/local/bin/cinder-rootwrap /etc/cinder/rootwrap.conf
|
|
||||||
class cinder::base (
|
class cinder::base (
|
||||||
$rabbit_password,
|
$rabbit_password,
|
||||||
$sql_connection,
|
$sql_connection,
|
||||||
@ -16,9 +12,9 @@ class cinder::base (
|
|||||||
$verbose = false
|
$verbose = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
warning('The "cinder::base" class is deprecated. Use "cinder" instead.')
|
warning('The cinder::base class is deprecated. Use cinder instead.')
|
||||||
|
|
||||||
class { "cinder":
|
class { 'cinder':
|
||||||
rabbit_password => $rabbit_password,
|
rabbit_password => $rabbit_password,
|
||||||
sql_connection => $sql_connection,
|
sql_connection => $sql_connection,
|
||||||
rabbit_host => $rabbit_host,
|
rabbit_host => $rabbit_host,
|
||||||
|
@ -18,13 +18,12 @@ class cinder::db::mysql (
|
|||||||
password => $password,
|
password => $password,
|
||||||
host => $host,
|
host => $host,
|
||||||
charset => $charset,
|
charset => $charset,
|
||||||
# I may want to inject some sql
|
|
||||||
require => Class['mysql::config'],
|
require => Class['mysql::config'],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $allowed_hosts {
|
if $allowed_hosts {
|
||||||
# TODO this class should be in the mysql namespace
|
# TODO this class should be in the mysql namespace
|
||||||
cinder::db::mysql::host_access { $allowed_hosts:
|
cinder::db::mysql::host_access { $allowed_hosts:
|
||||||
user => $user,
|
user => $user,
|
||||||
password => $password,
|
password => $password,
|
||||||
database => $dbname,
|
database => $dbname,
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
define cinder::db::mysql::host_access ($user, $password, $database) {
|
define cinder::db::mysql::host_access ($user, $password, $database) {
|
||||||
database_user { "${user}@${name}":
|
database_user { "${user}@${name}":
|
||||||
password_hash => mysql_password($password),
|
password_hash => mysql_password($password),
|
||||||
provider => 'mysql',
|
provider => 'mysql',
|
||||||
require => Database[$database],
|
require => Database[$database],
|
||||||
}
|
}
|
||||||
database_grant { "${user}@${name}/${database}":
|
database_grant { "${user}@${name}/${database}":
|
||||||
# TODO figure out which privileges to grant.
|
# TODO figure out which privileges to grant.
|
||||||
privileges => "all",
|
privileges => 'all',
|
||||||
provider => 'mysql',
|
provider => 'mysql',
|
||||||
require => Database_user["${user}@${name}"]
|
require => Database_user["${user}@${name}"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,14 @@ class cinder::db::postgresql(
|
|||||||
$user = 'cinder'
|
$user = 'cinder'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
require 'postgresql::python'
|
require postgresql::python
|
||||||
|
|
||||||
Postgresql::Db[$dbname] ~> Exec<| title == 'cinder-manage db_sync' |>
|
Postgresql::Db[$dbname] ~> Exec<| title == 'cinder-manage db_sync' |>
|
||||||
Package['python-psycopg2'] -> Exec<| title == 'cinder-manage db_sync' |>
|
Package['python-psycopg2'] -> Exec<| title == 'cinder-manage db_sync' |>
|
||||||
|
|
||||||
postgresql::db { "${dbname}":
|
postgresql::db { $dbname:
|
||||||
user => "${user}",
|
user => $user,
|
||||||
password => "${password}",
|
password => $password,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -80,13 +80,13 @@ class cinder (
|
|||||||
if $rabbit_hosts {
|
if $rabbit_hosts {
|
||||||
cinder_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
cinder_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||||
cinder_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
cinder_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||||
} else {
|
} else {
|
||||||
cinder_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
cinder_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||||
cinder_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
cinder_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||||
cinder_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
cinder_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||||
cinder_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
cinder_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $rpc_backend == 'cinder.openstack.common.rpc.impl_qpid' {
|
if $rpc_backend == 'cinder.openstack.common.rpc.impl_qpid' {
|
||||||
|
|
||||||
|
@ -29,11 +29,11 @@ class cinder::keystone::auth (
|
|||||||
keystone_service { $auth_name:
|
keystone_service { $auth_name:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
type => $service_type,
|
type => $service_type,
|
||||||
description => "Cinder Service",
|
description => 'Cinder Service',
|
||||||
}
|
}
|
||||||
|
|
||||||
if $configure_endpoint {
|
if $configure_endpoint {
|
||||||
keystone_endpoint { "${region}/$auth_name":
|
keystone_endpoint { "${region}/${auth_name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
public_url => "${public_protocol}://${public_address}:${port}/${volume_version}/%(tenant_id)s",
|
public_url => "${public_protocol}://${public_address}:${port}/${volume_version}/%(tenant_id)s",
|
||||||
admin_url => "http://${admin_address}:${port}/${volume_version}/%(tenant_id)s",
|
admin_url => "http://${admin_address}:${port}/${volume_version}/%(tenant_id)s",
|
||||||
|
@ -17,11 +17,11 @@ class cinder::qpid(
|
|||||||
$service_ensure = 'running'
|
$service_ensure = 'running'
|
||||||
|
|
||||||
qpid_user { $user:
|
qpid_user { $user:
|
||||||
password => $password,
|
password => $password,
|
||||||
file => $file,
|
file => $file,
|
||||||
realm => $realm,
|
realm => $realm,
|
||||||
provider => 'saslpasswd2',
|
provider => 'saslpasswd2',
|
||||||
require => Class['qpid::server'],
|
require => Class['qpid::server'],
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -29,7 +29,7 @@ class cinder::qpid(
|
|||||||
}
|
}
|
||||||
|
|
||||||
class { 'qpid::server':
|
class { 'qpid::server':
|
||||||
service_ensure => $service_ensure
|
service_ensure => $service_ensure
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
class cinder::rabbitmq(
|
class cinder::rabbitmq(
|
||||||
$userid ='guest',
|
$userid = 'guest',
|
||||||
$password ='guest',
|
$password = 'guest',
|
||||||
$port ='5672',
|
$port = '5672',
|
||||||
$virtual_host ='/',
|
$virtual_host = '/',
|
||||||
$enabled = true
|
$enabled = true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -19,10 +19,10 @@ class cinder::rabbitmq(
|
|||||||
} else {
|
} else {
|
||||||
$delete_guest_user = true
|
$delete_guest_user = true
|
||||||
rabbitmq_user { $userid:
|
rabbitmq_user { $userid:
|
||||||
admin => true,
|
admin => true,
|
||||||
password => $password,
|
password => $password,
|
||||||
provider => 'rabbitmqctl',
|
provider => 'rabbitmqctl',
|
||||||
require => Class['rabbitmq::server'],
|
require => Class['rabbitmq::server'],
|
||||||
}
|
}
|
||||||
# I need to figure out the appropriate permissions
|
# I need to figure out the appropriate permissions
|
||||||
rabbitmq_user_permissions { "${userid}@${virtual_host}":
|
rabbitmq_user_permissions { "${userid}@${virtual_host}":
|
||||||
@ -46,7 +46,7 @@ class cinder::rabbitmq(
|
|||||||
if ($enabled) {
|
if ($enabled) {
|
||||||
rabbitmq_vhost { $virtual_host:
|
rabbitmq_vhost { $virtual_host:
|
||||||
provider => 'rabbitmqctl',
|
provider => 'rabbitmqctl',
|
||||||
require => Class['rabbitmq::server'],
|
require => Class['rabbitmq::server'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ class cinder::volume::glusterfs (
|
|||||||
$glusterfs_disk_util = undef,
|
$glusterfs_disk_util = undef,
|
||||||
$glusterfs_sparsed_volumes = undef,
|
$glusterfs_sparsed_volumes = undef,
|
||||||
$glusterfs_mount_point_base = undef,
|
$glusterfs_mount_point_base = undef,
|
||||||
$glusterfs_shares_config = "/etc/cinder/shares.conf"
|
$glusterfs_shares_config = '/etc/cinder/shares.conf'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$content = join($glusterfs_shares, "\n")
|
$content = join($glusterfs_shares, "\n")
|
||||||
|
@ -11,7 +11,7 @@ class cinder::volume::iscsi (
|
|||||||
'DEFAULT/iscsi_ip_address': value => $iscsi_ip_address;
|
'DEFAULT/iscsi_ip_address': value => $iscsi_ip_address;
|
||||||
'DEFAULT/iscsi_helper': value => $iscsi_helper;
|
'DEFAULT/iscsi_helper': value => $iscsi_helper;
|
||||||
'DEFAULT/volume_group': value => $volume_group;
|
'DEFAULT/volume_group': value => $volume_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
case $iscsi_helper {
|
case $iscsi_helper {
|
||||||
'tgtadm': {
|
'tgtadm': {
|
||||||
@ -22,11 +22,11 @@ class cinder::volume::iscsi (
|
|||||||
|
|
||||||
if($::osfamily == 'RedHat') {
|
if($::osfamily == 'RedHat') {
|
||||||
file_line { 'cinder include':
|
file_line { 'cinder include':
|
||||||
path => '/etc/tgt/targets.conf',
|
path => '/etc/tgt/targets.conf',
|
||||||
line => "include /etc/cinder/volumes/*",
|
line => 'include /etc/cinder/volumes/*',
|
||||||
match => '#?include /',
|
match => '#?include /',
|
||||||
require => Package['tgt'],
|
require => Package['tgt'],
|
||||||
notify => Service['tgtd'],
|
notify => Service['tgtd'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class cinder::volume::nfs (
|
|||||||
$nfs_disk_util = undef,
|
$nfs_disk_util = undef,
|
||||||
$nfs_sparsed_volumes = undef,
|
$nfs_sparsed_volumes = undef,
|
||||||
$nfs_mount_point_base = undef,
|
$nfs_mount_point_base = undef,
|
||||||
$nfs_shares_config = "/etc/cinder/shares.conf"
|
$nfs_shares_config = '/etc/cinder/shares.conf'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
file {$nfs_shares_config:
|
file {$nfs_shares_config:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user