Various Puppet lint fixes
* Fix following warnings: * double quoted string containing no variables * indentation of => is not properly aligned * mode should be represented as a 4 digit octal value or symbolic mode * string containing only a variable * top-scope variable being used without an explicit namespace * unquoted file mode * variable not enclosed in {} * Fix following errors: * trailing whitespace found * two-space soft tabs not used * Remove quotes around class in include/require statements Change-Id: Ia920d848e1955612a6486ec8731309e6d3a70f63
This commit is contained in:
parent
cb2e06556d
commit
178f4b18dc
@ -10,7 +10,7 @@ class swift::auth_file (
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0600',
|
||||
content =>
|
||||
content =>
|
||||
"
|
||||
export ST_USER=${admin_tenant}:${admin_user}
|
||||
export ST_KEY=${admin_password}
|
||||
|
@ -84,7 +84,7 @@ class swift::dispersion (
|
||||
timeout => 0,
|
||||
onlyif => "swift -A ${auth_url} -U ${auth_tenant}:${auth_user} -K ${auth_pass} -V ${auth_version} stat | grep 'Account: '",
|
||||
unless => "swift -A ${auth_url} -U ${auth_tenant}:${auth_user} -K ${auth_pass} -V ${auth_version} list | grep dispersion_",
|
||||
require => Package["swiftclient"],
|
||||
require => Package['swiftclient'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,19 +45,19 @@ class swift(
|
||||
|
||||
file { '/home/swift':
|
||||
ensure => directory,
|
||||
mode => 0700,
|
||||
mode => '0700',
|
||||
}
|
||||
|
||||
file { '/etc/swift':
|
||||
ensure => directory,
|
||||
mode => 2770,
|
||||
mode => '2770',
|
||||
}
|
||||
user {'swift':
|
||||
ensure => present,
|
||||
}
|
||||
file { '/var/lib/swift':
|
||||
ensure => directory,
|
||||
owner => 'swift'
|
||||
owner => 'swift'
|
||||
}
|
||||
file { '/var/run/swift':
|
||||
ensure => directory,
|
||||
@ -65,7 +65,7 @@ class swift(
|
||||
|
||||
file { '/etc/swift/swift.conf':
|
||||
ensure => present,
|
||||
mode => 0660,
|
||||
mode => '0660',
|
||||
content => template('swift/swift.conf.erb'),
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ class swift::keystone::auth(
|
||||
) {
|
||||
|
||||
if $address != '127.0.0.1' {
|
||||
warning("Address parameter for swift::keystone::auth has been deprecated, use public_address instead")
|
||||
warning('Address parameter for swift::keystone::auth has been deprecated, use public_address instead')
|
||||
}
|
||||
|
||||
if ! $public_port {
|
||||
|
@ -1,5 +1,5 @@
|
||||
class swift::params {
|
||||
case $osfamily {
|
||||
case $::osfamily {
|
||||
'Debian': {
|
||||
$package_name = 'swift'
|
||||
$client_package = 'python-swiftclient'
|
||||
@ -51,7 +51,7 @@ class swift::params {
|
||||
$swift3 = 'openstack-swift-plugin-swift3'
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${osfamily} for os ${operatingsystem}")
|
||||
fail("Unsupported osfamily: ${::osfamily} for os ${::operatingsystem}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,8 +55,8 @@ class swift::proxy(
|
||||
$package_ensure = 'present'
|
||||
) {
|
||||
|
||||
include 'swift::params'
|
||||
include 'concat::setup'
|
||||
include swift::params
|
||||
include concat::setup
|
||||
|
||||
validate_bool($account_autocreate)
|
||||
validate_bool($allow_account_management)
|
||||
@ -77,7 +77,7 @@ class swift::proxy(
|
||||
}
|
||||
|
||||
if($auth_type == 'tempauth' and ! $account_autocreate ){
|
||||
fail("\$account_autocreate must be set to true when auth type is tempauth")
|
||||
fail('account_autocreate must be set to true when auth_type is tempauth')
|
||||
}
|
||||
|
||||
package { 'swift-proxy':
|
||||
@ -102,7 +102,7 @@ class swift::proxy(
|
||||
|
||||
# you can now add your custom fragments at the user level
|
||||
concat::fragment { 'swift_proxy':
|
||||
target => "/etc/swift/proxy-server.conf",
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy-server.conf.erb'),
|
||||
order => '00',
|
||||
# require classes for each of the elements of the pipeline
|
||||
|
@ -61,7 +61,7 @@ class swift::proxy::authtoken(
|
||||
validate_re($auth_admin_prefix, '^(/.+[^/])?$')
|
||||
}
|
||||
|
||||
concat::fragment { "swift_authtoken":
|
||||
concat::fragment { 'swift_authtoken':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/authtoken.conf.erb'),
|
||||
order => '22',
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# include 'swift::proxy::catch_errors'
|
||||
# include swift::proxy::catch_errors
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# include 'swift::proxy::formpost'
|
||||
# include swift::proxy::formpost
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
|
@ -27,11 +27,11 @@ class swift::proxy::s3token(
|
||||
$auth_protocol = 'http'
|
||||
) {
|
||||
|
||||
include keystone::python
|
||||
|
||||
concat::fragment { 'swift_s3token':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/s3token.conf.erb'),
|
||||
order => '28',
|
||||
}
|
||||
|
||||
include 'keystone::python'
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class swift::proxy::swift3(
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
include $::swift::params
|
||||
include swift::params
|
||||
|
||||
package { 'swift-plugin-s3':
|
||||
name => $::swift::params::swift3,
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# include 'swift::proxy::tempurl'
|
||||
# include swift::proxy::tempurl
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
|
@ -29,12 +29,12 @@ class swift::ringserver(
|
||||
use_chroot => 'no',
|
||||
}
|
||||
|
||||
rsync::server::module { "swift_server":
|
||||
path => '/etc/swift',
|
||||
lock_file => "/var/lock/swift_server.lock",
|
||||
uid => 'swift',
|
||||
gid => 'swift',
|
||||
rsync::server::module { 'swift_server':
|
||||
path => '/etc/swift',
|
||||
lock_file => '/var/lock/swift_server.lock',
|
||||
uid => 'swift',
|
||||
gid => 'swift',
|
||||
max_connections => $max_connections,
|
||||
read_only => true,
|
||||
read_only => true,
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ class swift::storage::account(
|
||||
}
|
||||
|
||||
service { 'swift-account-reaper':
|
||||
name => $::swift::params::account_reaper_service_name,
|
||||
name => $::swift::params::account_reaper_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
@ -14,7 +14,7 @@ class swift::storage::account(
|
||||
}
|
||||
|
||||
service { 'swift-account-auditor':
|
||||
name => $::swift::params::account_auditor_service_name,
|
||||
name => $::swift::params::account_auditor_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*allowed_sync_hosts*] A list of hosts allowed in the X-Container-Sync-To
|
||||
# [*allowed_sync_hosts*] A list of hosts allowed in the X-Container-Sync-To
|
||||
# field for containers. Defaults to one entry list '127.0.0.1'.
|
||||
#
|
||||
class swift::storage::container(
|
||||
@ -13,21 +13,21 @@ class swift::storage::container(
|
||||
}
|
||||
|
||||
service { 'swift-container-updater':
|
||||
name => $::swift::params::container_updater_service_name,
|
||||
name => $::swift::params::container_updater_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
require => Package['swift-container'],
|
||||
}
|
||||
service { 'swift-container-auditor':
|
||||
name => $::swift::params::container_auditor_service_name,
|
||||
name => $::swift::params::container_auditor_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
require => Package['swift-container'],
|
||||
}
|
||||
|
||||
if $operatingsystem == 'Ubuntu' {
|
||||
if $::operatingsystem == 'Ubuntu' {
|
||||
# The following service conf is missing in Ubunty 12.04
|
||||
file { '/etc/init/swift-container-sync.conf':
|
||||
source => 'puppet:///modules/swift/swift-container-sync.conf.upstart',
|
||||
|
@ -6,7 +6,7 @@
|
||||
# this define needs to be sent a refresh signal to do anything
|
||||
#
|
||||
#
|
||||
# [*title*]
|
||||
# [*title*]
|
||||
#
|
||||
# [*byte_size*] Byte size to use for every inode in the created filesystem.
|
||||
# It is recommened to use 1024 to ensure that the metadata can fit in a single inode.
|
||||
|
@ -42,6 +42,8 @@ define swift::storage::loopback(
|
||||
subscribe => Exec["create_partition-${name}"],
|
||||
loopback => true,
|
||||
}
|
||||
$device_config_hash = {"$name" => $storage_params,}
|
||||
create_resources("swift::storage::$fstype", $device_config_hash)
|
||||
# NOTE(mgagne) Puppet does not allow hash keys to be bare variables.
|
||||
# Keep double-quotes to avoid parse errors.
|
||||
$device_config_hash = { "${name}" => $storage_params }
|
||||
create_resources("swift::storage::${fstype}", $device_config_hash)
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ define swift::storage::mount(
|
||||
}
|
||||
|
||||
if($fstype == 'xfs'){
|
||||
$fsoptions = 'logbufs=8'
|
||||
$fsoptions = 'logbufs=8'
|
||||
} else {
|
||||
$fsoptions = 'user_xattr'
|
||||
$fsoptions = 'user_xattr'
|
||||
}
|
||||
|
||||
# the directory that represents the mount point
|
||||
@ -34,7 +34,7 @@ define swift::storage::mount(
|
||||
ensure => present,
|
||||
device => $device,
|
||||
fstype => $fstype,
|
||||
options => "$options,$fsoptions",
|
||||
options => "${options},${fsoptions}",
|
||||
require => File["${mnt_base_dir}/${name}"]
|
||||
}
|
||||
|
||||
|
@ -24,28 +24,28 @@ define swift::storage::node(
|
||||
}
|
||||
|
||||
swift::storage::server { "60${name}0":
|
||||
type => 'object',
|
||||
type => 'object',
|
||||
config_file_path => 'object-server.conf',
|
||||
}
|
||||
ring_object_device { "${storage_local_net_ip}:60${name}0/$name":
|
||||
ring_object_device { "${storage_local_net_ip}:60${name}0/${name}":
|
||||
zone => $zone,
|
||||
weight => $weight,
|
||||
}
|
||||
|
||||
swift::storage::server { "60${name}1":
|
||||
type => 'container',
|
||||
type => 'container',
|
||||
config_file_path => 'container-server.conf',
|
||||
}
|
||||
ring_container_device { "${storage_local_net_ip}:60${name}1/$name":
|
||||
ring_container_device { "${storage_local_net_ip}:60${name}1/${name}":
|
||||
zone => $zone,
|
||||
weight => $weight,
|
||||
}
|
||||
|
||||
swift::storage::server { "60${name}2":
|
||||
type => 'account',
|
||||
type => 'account',
|
||||
config_file_path => 'account-server.conf',
|
||||
}
|
||||
ring_account_device { "${storage_local_net_ip}:60${name}2/$name":
|
||||
ring_account_device { "${storage_local_net_ip}:60${name}2/${name}":
|
||||
zone => $zone,
|
||||
weight => $weight,
|
||||
}
|
||||
|
@ -6,14 +6,14 @@ class swift::storage::object(
|
||||
}
|
||||
|
||||
service { 'swift-object-updater':
|
||||
name => $::swift::params::object_updater_service_name,
|
||||
name => $::swift::params::object_updater_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
require => Package['swift-object'],
|
||||
}
|
||||
service { 'swift-object-auditor':
|
||||
name => $::swift::params::object_auditor_service_name,
|
||||
name => $::swift::params::object_auditor_service_name,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
provider => $::swift::params::service_provider,
|
||||
|
@ -28,13 +28,13 @@ define swift::storage::server(
|
||||
# TODO if array does not include type-server, warn
|
||||
if(
|
||||
(is_array($pipeline) and ! member($pipeline, "${type}-server")) or
|
||||
"$pipeline" != "${type}-server"
|
||||
$pipeline != "${type}-server"
|
||||
) {
|
||||
warning("swift storage server ${type} must specify ${type}-server")
|
||||
}
|
||||
|
||||
include "swift::storage::$type"
|
||||
include 'concat::setup'
|
||||
include "swift::storage::${type}"
|
||||
include concat::setup
|
||||
|
||||
validate_re($name, '^\d+$')
|
||||
validate_re($type, '^object|container|account$')
|
||||
@ -44,13 +44,13 @@ define swift::storage::server(
|
||||
|
||||
$bind_port = $name
|
||||
|
||||
rsync::server::module { "${type}":
|
||||
path => $devices,
|
||||
lock_file => "/var/lock/${type}.lock",
|
||||
uid => $owner,
|
||||
gid => $group,
|
||||
rsync::server::module { $type:
|
||||
path => $devices,
|
||||
lock_file => "/var/lock/${type}.lock",
|
||||
uid => $owner,
|
||||
gid => $group,
|
||||
max_connections => $max_connections,
|
||||
read_only => false,
|
||||
read_only => false,
|
||||
}
|
||||
|
||||
concat { "/etc/swift/${config_file_path}":
|
||||
|
@ -37,7 +37,7 @@ class swift::test_file (
|
||||
$user = 'admin'
|
||||
) {
|
||||
file { '/tmp/swift_test_file.rb':
|
||||
mode => '755',
|
||||
mode => '0755',
|
||||
content => template('swift/swift_keystone_test.erb')
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ require 'spec_helper'
|
||||
describe 'swift::proxy::swift3' do
|
||||
|
||||
let :facts do
|
||||
{
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}
|
||||
{ :concat_basedir => '/var/lib/puppet/concat',
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Ubuntu' }
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
|
@ -18,7 +18,7 @@ class { 'memcached':
|
||||
class { 'swift':
|
||||
# not sure how I want to deal with this shared secret
|
||||
swift_hash_suffix => $swift_shared_secret,
|
||||
package_ensure => latest,
|
||||
package_ensure => latest,
|
||||
}
|
||||
|
||||
# === Configure Storage
|
||||
|
@ -25,7 +25,7 @@
|
||||
#$swift_admin_password = 'admin_password'
|
||||
$swift_admin_password = hiera('admin_password', 'admin_password')
|
||||
|
||||
# swift specific configurations
|
||||
# swift specific configurations
|
||||
#$swift_shared_secret = 'changeme'
|
||||
$swift_shared_secret = hiera('swift_shared_secret', 'changeme')
|
||||
|
||||
@ -250,8 +250,8 @@ node /swift-proxy/ inherits swift_base {
|
||||
|
||||
# exports rsync gets that can be used to sync the ring files
|
||||
@@swift::ringsync { ['account', 'object', 'container']:
|
||||
ring_server => $swift_local_net_ip
|
||||
}
|
||||
ring_server => $swift_local_net_ip
|
||||
}
|
||||
|
||||
# deploy a script that can be used for testing
|
||||
class { 'swift::test_file':
|
||||
|
Loading…
Reference in New Issue
Block a user