Various Puppet lint fixes
* Fix following warnings: * double quoted string containing no variables * indentation of => is not properly aligned * quoted boolean value found * variable not enclosed in {} * Fix following errors: * two-space soft tabs not used * Remove quotes around class in include/require statements * Remove some comments from the code, they added no value Change-Id: I341b37f2c6795951f3285037b2fa612d767a4474
This commit is contained in:
parent
ffbe1c566f
commit
d5567e6aef
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# == Paremeters:
|
||||
# == Parameters
|
||||
#
|
||||
#
|
||||
# * keystone_password Password used to authemn
|
||||
|
@ -63,8 +63,7 @@ class glance::api(
|
|||
$sql_connection = 'sqlite:///var/lib/glance/glance.sqlite'
|
||||
) inherits glance {
|
||||
|
||||
# used to configure concat
|
||||
require 'keystone::python'
|
||||
require keystone::python
|
||||
|
||||
validate_re($sql_connection, '(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
|
@ -125,7 +124,8 @@ class glance::api(
|
|||
}
|
||||
|
||||
# db connection config
|
||||
# I do not believe this was required in Essex. Does the API server now need to connect to the DB?
|
||||
# I do not believe this was required in Essex.
|
||||
# Does the API server now need to connect to the DB?
|
||||
# TODO figure out if I need this...
|
||||
glance_api_config {
|
||||
'DEFAULT/sql_connection': value => $sql_connection;
|
||||
|
@ -134,9 +134,9 @@ class glance::api(
|
|||
|
||||
# auth config
|
||||
glance_api_config {
|
||||
'keystone_authtoken/auth_host': value => $auth_host;
|
||||
'keystone_authtoken/auth_port': value => $auth_port;
|
||||
'keystone_authtoken/auth_protocol': value => $auth_protocol;
|
||||
'keystone_authtoken/auth_host': value => $auth_host;
|
||||
'keystone_authtoken/auth_port': value => $auth_port;
|
||||
'keystone_authtoken/auth_protocol': value => $auth_protocol;
|
||||
}
|
||||
|
||||
if $auth_admin_prefix {
|
||||
|
@ -179,8 +179,7 @@ class glance::api(
|
|||
|
||||
file { ['/etc/glance/glance-api.conf',
|
||||
'/etc/glance/glance-api-paste.ini',
|
||||
'/etc/glance/glance-cache.conf'
|
||||
]:
|
||||
'/etc/glance/glance-cache.conf']:
|
||||
}
|
||||
|
||||
if $enabled {
|
||||
|
|
|
@ -16,20 +16,19 @@ class glance::db::mysql(
|
|||
Class['glance::db::mysql'] -> Exec<| title == 'glance-manage db_sync' |>
|
||||
Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
|
||||
|
||||
require 'mysql::python'
|
||||
require mysql::python
|
||||
|
||||
mysql::db { $dbname:
|
||||
user => $user,
|
||||
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
|
||||
glance::db::mysql::host_access { $allowed_hosts:
|
||||
# TODO this class should be in the mysql namespace
|
||||
glance::db::mysql::host_access { $allowed_hosts:
|
||||
user => $user,
|
||||
password => $password,
|
||||
database => $dbname,
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
define glance::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}"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,14 +8,14 @@ class glance::db::postgresql(
|
|||
$user = 'glance'
|
||||
) {
|
||||
|
||||
require 'postgresql::python'
|
||||
require postgresql::python
|
||||
|
||||
Postgresql::Db[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
|
||||
Package['python-psycopg2'] -> Exec<| title == 'glance-manage db_sync' |>
|
||||
|
||||
postgresql::db { "${dbname}":
|
||||
user => "${user}",
|
||||
password => "${password}",
|
||||
postgresql::db { $dbname:
|
||||
user => $user,
|
||||
password => $password,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,17 +38,20 @@ class glance::keystone::auth(
|
|||
email => $email,
|
||||
tenant => $tenant,
|
||||
}
|
||||
|
||||
keystone_user_role { "${auth_name}@${tenant}":
|
||||
ensure => present,
|
||||
roles => 'admin',
|
||||
}
|
||||
|
||||
keystone_service { $auth_name:
|
||||
ensure => present,
|
||||
type => $service_type,
|
||||
description => "Openstack Image Service",
|
||||
description => 'Openstack Image Service',
|
||||
}
|
||||
|
||||
if $configure_endpoint {
|
||||
keystone_endpoint { "${region}/$auth_name":
|
||||
keystone_endpoint { "${region}/${auth_name}":
|
||||
ensure => present,
|
||||
public_url => "${public_protocol}://${public_address}:${port}",
|
||||
admin_url => "http://${admin_address}:${port}",
|
||||
|
|
|
@ -81,7 +81,7 @@ class glance::registry(
|
|||
$enabled = true
|
||||
) inherits glance {
|
||||
|
||||
require 'keystone::python'
|
||||
require keystone::python
|
||||
|
||||
validate_re($sql_connection, '(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
|
@ -99,7 +99,7 @@ class glance::registry(
|
|||
}
|
||||
|
||||
if($sql_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
require 'mysql::python'
|
||||
require mysql::python
|
||||
} elsif($sql_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
|
||||
} elsif($sql_connection =~ /sqlite:\/\//) {
|
||||
|
@ -108,7 +108,6 @@ class glance::registry(
|
|||
fail("Invalid db connection ${sql_connection}")
|
||||
}
|
||||
|
||||
# basic service config
|
||||
glance_registry_config {
|
||||
'DEFAULT/verbose': value => $verbose;
|
||||
'DEFAULT/debug': value => $debug;
|
||||
|
@ -116,7 +115,6 @@ class glance::registry(
|
|||
'DEFAULT/bind_port': value => $bind_port;
|
||||
}
|
||||
|
||||
# db connection config
|
||||
glance_registry_config {
|
||||
'DEFAULT/sql_connection': value => $sql_connection;
|
||||
'DEFAULT/sql_idle_timeout': value => $sql_idle_timeout;
|
||||
|
@ -162,8 +160,7 @@ class glance::registry(
|
|||
}
|
||||
|
||||
file { ['/etc/glance/glance-registry.conf',
|
||||
'/etc/glance/glance-registry-paste.ini'
|
||||
]:
|
||||
'/etc/glance/glance-registry-paste.ini']:
|
||||
}
|
||||
|
||||
if $enabled {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
class glance::scrubber (
|
||||
|
||||
) {
|
||||
fail("glance::scrubber needs to be implemented")
|
||||
class glance::scrubber {
|
||||
fail('glance::scrubber needs to be implemented')
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class { 'glance::api':
|
||||
debug => 'true',
|
||||
verbose => 'true',
|
||||
debug => true,
|
||||
verbose => true,
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class { 'glance::registry':
|
||||
debug =>'true',
|
||||
verbose => 'true',
|
||||
debug => true,
|
||||
verbose => true,
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ Exec { logoutput => 'on_failure' }
|
|||
node glance_keystone_mysql {
|
||||
class { 'mysql::server': }
|
||||
class { 'keystone':
|
||||
verbose => true,
|
||||
debug => true,
|
||||
verbose => true,
|
||||
debug => true,
|
||||
catalog_type => 'sql',
|
||||
admin_token => 'admin_token',
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ node default {
|
|||
class role_glance_mysql {
|
||||
|
||||
class { 'glance::api':
|
||||
verbose => 'True',
|
||||
debug => 'True',
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
|
@ -46,18 +46,17 @@ class role_glance_mysql {
|
|||
dbname => 'glance',
|
||||
user => 'glance',
|
||||
host => '127.0.0.1',
|
||||
# allowed_hosts = undef,
|
||||
# $cluster_id = 'localzone'
|
||||
# allowed_hosts = undef,
|
||||
# $cluster_id = 'localzone'
|
||||
}
|
||||
|
||||
class { 'glance::registry':
|
||||
verbose => 'True',
|
||||
debug => 'True',
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => 'glance_password',
|
||||
sql_connection => 'mysql://glance:glance@127.0.0.1/glance',
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue