diff --git a/manifests/base.pp b/manifests/base.pp index 808be5d1..575d4968 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -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 ( $rabbit_password, $sql_connection, @@ -16,9 +12,9 @@ class cinder::base ( $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, sql_connection => $sql_connection, rabbit_host => $rabbit_host, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index e0660553..57c410f2 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -18,13 +18,12 @@ class cinder::db::mysql ( password => $password, host => $host, charset => $charset, - # I may want to inject some sql require => Class['mysql::config'], } if $allowed_hosts { - # TODO this class should be in the mysql namespace - cinder::db::mysql::host_access { $allowed_hosts: + # TODO this class should be in the mysql namespace + cinder::db::mysql::host_access { $allowed_hosts: user => $user, password => $password, database => $dbname, diff --git a/manifests/db/mysql/host_access.pp b/manifests/db/mysql/host_access.pp index 8cca4287..993f5a03 100644 --- a/manifests/db/mysql/host_access.pp +++ b/manifests/db/mysql/host_access.pp @@ -4,13 +4,13 @@ define cinder::db::mysql::host_access ($user, $password, $database) { database_user { "${user}@${name}": password_hash => mysql_password($password), - provider => 'mysql', - require => Database[$database], + provider => 'mysql', + require => Database[$database], } database_grant { "${user}@${name}/${database}": # TODO figure out which privileges to grant. - privileges => "all", - provider => 'mysql', - require => Database_user["${user}@${name}"] + privileges => 'all', + provider => 'mysql', + require => Database_user["${user}@${name}"] } } diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 5fac772d..52aa15bb 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -8,14 +8,14 @@ class cinder::db::postgresql( $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' |> - postgresql::db { "${dbname}": - user => "${user}", - password => "${password}", + postgresql::db { $dbname: + user => $user, + password => $password, } } diff --git a/manifests/init.pp b/manifests/init.pp index dae3983a..f3c88b53 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -80,13 +80,13 @@ class cinder ( if $rabbit_hosts { cinder_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') } cinder_config { 'DEFAULT/rabbit_ha_queues': value => true } - } else { - cinder_config { 'DEFAULT/rabbit_host': value => $rabbit_host } - cinder_config { 'DEFAULT/rabbit_port': value => $rabbit_port } - cinder_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" } - cinder_config { 'DEFAULT/rabbit_ha_queues': value => false } - } - } + } else { + cinder_config { 'DEFAULT/rabbit_host': value => $rabbit_host } + cinder_config { 'DEFAULT/rabbit_port': value => $rabbit_port } + cinder_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" } + cinder_config { 'DEFAULT/rabbit_ha_queues': value => false } + } + } if $rpc_backend == 'cinder.openstack.common.rpc.impl_qpid' { diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index aa79ed2b..7d8faf9e 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -29,11 +29,11 @@ class cinder::keystone::auth ( keystone_service { $auth_name: ensure => present, type => $service_type, - description => "Cinder Service", + description => 'Cinder Service', } if $configure_endpoint { - keystone_endpoint { "${region}/$auth_name": + keystone_endpoint { "${region}/${auth_name}": ensure => present, public_url => "${public_protocol}://${public_address}:${port}/${volume_version}/%(tenant_id)s", admin_url => "http://${admin_address}:${port}/${volume_version}/%(tenant_id)s", diff --git a/manifests/qpid.pp b/manifests/qpid.pp index 1690e34b..6b4d2985 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -17,11 +17,11 @@ class cinder::qpid( $service_ensure = 'running' qpid_user { $user: - password => $password, - file => $file, - realm => $realm, + password => $password, + file => $file, + realm => $realm, provider => 'saslpasswd2', - require => Class['qpid::server'], + require => Class['qpid::server'], } } else { @@ -29,7 +29,7 @@ class cinder::qpid( } class { 'qpid::server': - service_ensure => $service_ensure + service_ensure => $service_ensure } } diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp index 2f208388..df10c004 100644 --- a/manifests/rabbitmq.pp +++ b/manifests/rabbitmq.pp @@ -3,10 +3,10 @@ # # class cinder::rabbitmq( - $userid ='guest', - $password ='guest', - $port ='5672', - $virtual_host ='/', + $userid = 'guest', + $password = 'guest', + $port = '5672', + $virtual_host = '/', $enabled = true ) { @@ -19,10 +19,10 @@ class cinder::rabbitmq( } else { $delete_guest_user = true rabbitmq_user { $userid: - admin => true, - password => $password, + admin => true, + password => $password, provider => 'rabbitmqctl', - require => Class['rabbitmq::server'], + require => Class['rabbitmq::server'], } # I need to figure out the appropriate permissions rabbitmq_user_permissions { "${userid}@${virtual_host}": @@ -46,7 +46,7 @@ class cinder::rabbitmq( if ($enabled) { rabbitmq_vhost { $virtual_host: provider => 'rabbitmqctl', - require => Class['rabbitmq::server'], + require => Class['rabbitmq::server'], } } } diff --git a/manifests/volume/glusterfs.pp b/manifests/volume/glusterfs.pp index 49eb340f..f1c35bf7 100644 --- a/manifests/volume/glusterfs.pp +++ b/manifests/volume/glusterfs.pp @@ -37,7 +37,7 @@ class cinder::volume::glusterfs ( $glusterfs_disk_util = undef, $glusterfs_sparsed_volumes = 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") diff --git a/manifests/volume/iscsi.pp b/manifests/volume/iscsi.pp index 4099b876..b68ffcfe 100644 --- a/manifests/volume/iscsi.pp +++ b/manifests/volume/iscsi.pp @@ -11,7 +11,7 @@ class cinder::volume::iscsi ( 'DEFAULT/iscsi_ip_address': value => $iscsi_ip_address; 'DEFAULT/iscsi_helper': value => $iscsi_helper; 'DEFAULT/volume_group': value => $volume_group; - } + } case $iscsi_helper { 'tgtadm': { @@ -22,11 +22,11 @@ class cinder::volume::iscsi ( if($::osfamily == 'RedHat') { file_line { 'cinder include': - path => '/etc/tgt/targets.conf', - line => "include /etc/cinder/volumes/*", - match => '#?include /', + path => '/etc/tgt/targets.conf', + line => 'include /etc/cinder/volumes/*', + match => '#?include /', require => Package['tgt'], - notify => Service['tgtd'], + notify => Service['tgtd'], } } diff --git a/manifests/volume/nfs.pp b/manifests/volume/nfs.pp index 1c925b92..ffdbbaf0 100644 --- a/manifests/volume/nfs.pp +++ b/manifests/volume/nfs.pp @@ -5,7 +5,7 @@ class cinder::volume::nfs ( $nfs_disk_util = undef, $nfs_sparsed_volumes = undef, $nfs_mount_point_base = undef, - $nfs_shares_config = "/etc/cinder/shares.conf" + $nfs_shares_config = '/etc/cinder/shares.conf' ) { file {$nfs_shares_config: