roles: lint recipes (no changes)

This commit is contained in:
Sebastien Badia
2013-11-04 18:14:30 +01:00
parent 19861424dd
commit a8b547b1f8
13 changed files with 179 additions and 177 deletions

View File

@@ -20,81 +20,81 @@
# Parameters of eNovance CI
class os_params {
$site_domain = "enovance.com"
$os_release = "havana"
$region = "enovance-ci"
$site_domain = 'enovance.com'
$os_release = 'havana'
$region = 'enovance-ci'
$storage = True
$compute = False
$install_packages = False
# Root hashed password (enovance by default)
$root_password = "$1$2X/chMfy$CuJ4xPZY0WO2pRfIm5djn/"
$root_password = '$1$2X/chMfy$CuJ4xPZY0WO2pRfIm5djn/'
# Databases
$keystone_db_host = "10.68.0.47"
$keystone_db_user = "keystone"
$keystone_db_password = "rooghah0phe1tieDeixoodo0quil8iox"
$keystone_allowed_hosts = ["os-ci-test%", "10.68.0.%"]
$keystone_db_host = '10.68.0.47'
$keystone_db_user = 'keystone'
$keystone_db_password = 'rooghah0phe1tieDeixoodo0quil8iox'
$keystone_allowed_hosts = ['os-ci-test%', '10.68.0.%']
# Extra roles:
$keystone_roles_addons = ["SwiftOperator", "ResellerAdmin"]
$keystone_roles_addons = ['SwiftOperator', 'ResellerAdmin']
$ceilometer_database_connection = 'mongodb://10.68.0.47/ceilometer'
# Keystone Users
$ks_admin_token = "iw3feche3JeeYo9mejoohaugai3thohahwo9tiuyoe5Thier8Eiwah8K"
$ks_admin_email = "dev@enovance.com"
$ks_admin_password = "Xokoph5io2aenaoh0nuiquei9aineigo"
$ks_admin_tenant = "admin"
$ks_admin_token = 'iw3feche3JeeYo9mejoohaugai3thohahwo9tiuyoe5Thier8Eiwah8K'
$ks_admin_email = 'dev@enovance.com'
$ks_admin_password = 'Xokoph5io2aenaoh0nuiquei9aineigo'
$ks_admin_tenant = 'admin'
$ks_swift_dispersion_password = "aipee1die1eeSohph9yae8eeluthaleu"
$ks_swift_password = "cwnu6Eeph4jahsh5wooch5Panahjaidie8"
$ks_ceilometer_password = "eafhafbheafaefaejiiutiu7374aesf3aiNu"
$ks_swift_dispersion_password = 'aipee1die1eeSohph9yae8eeluthaleu'
$ks_swift_password = 'cwnu6Eeph4jahsh5wooch5Panahjaidie8'
$ks_ceilometer_password = 'eafhafbheafaefaejiiutiu7374aesf3aiNu'
$keystone_memchached = ["10.68.0.47:11211"]
$keystone_memchached = ['10.68.0.47:11211']
# API Ports
$swift_port = "8080"
$keystone_port = "5000"
$keystone_admin_port = "35357"
$ceilometer_port = "8777"
$swift_port = '8080'
$keystone_port = '5000'
$keystone_admin_port = '35357'
$ceilometer_port = '8777'
# Keystone Endpoints
$ks_keystone_public_proto = "http"
$ks_keystone_public_port = "5000"
$ks_keystone_public_host = "os-ci-test3.enovance.com" # ipvs lb web
$ks_keystone_internal_host = "os-ci-test3.enovance.com" # ipvs lb int # can be used for now
$ks_keystone_admin_host = "os-ci-test3.enovance.com" # ipvs lb int # can be used for now
$ks_keystone_public_proto = 'http'
$ks_keystone_public_port = '5000'
$ks_keystone_public_host = 'os-ci-test3.enovance.com' # ipvs lb web
$ks_keystone_internal_host = 'os-ci-test3.enovance.com' # ipvs lb int # can be used for now
$ks_keystone_admin_host = 'os-ci-test3.enovance.com' # ipvs lb int # can be used for now
$ks_swift_public_proto = "http"
$ks_swift_public_port = "8080"
$ks_swift_public_host = "os-ci-test3.enovance.com"
$ks_swift_admin_host = "os-ci-test3.enovance.com"
$ks_swift_internal_host = "os-ci-test3.enovance.com"
$ks_swift_public_proto = 'http'
$ks_swift_public_port = '8080'
$ks_swift_public_host = 'os-ci-test3.enovance.com'
$ks_swift_admin_host = 'os-ci-test3.enovance.com'
$ks_swift_internal_host = 'os-ci-test3.enovance.com'
$ks_ceilometer_public_proto = "http"
$ks_ceilometer_public_host = "os-ci-test3.enovance.com"
$ks_ceilometer_admin_host = "os-ci-test3.enovance.com"
$ks_ceilometer_internal_host = "os-ci-test3.enovance.com"
$ks_ceilometer_public_proto = 'http'
$ks_ceilometer_public_host = 'os-ci-test3.enovance.com'
$ks_ceilometer_admin_host = 'os-ci-test3.enovance.com'
$ks_ceilometer_internal_host = 'os-ci-test3.enovance.com'
# swift
$swift_cors_allow_origin = "http://os-ci-test3.enovance.com"
$swift_hash_suffix = "ni2aseiWi8ich3oo"
$swift_cors_allow_origin = 'http://os-ci-test3.enovance.com'
$swift_hash_suffix = 'ni2aseiWi8ich3oo'
$swift_rsync_max_connections = 5
$swift_memchached = ["10.68.0.47:11211"]
$statsd_host = "127.0.0.1"
$statsd_port = "4125"
$swift_memchached = ['10.68.0.47:11211']
$statsd_host = '127.0.0.1'
$statsd_port = '4125'
$os_swift_zone = {
'os-ci-test8' => 1,
'os-ci-test9' => 2,
'os-ci-test12' => 3,
'os-ci-test8' => 1,
'os-ci-test9' => 2,
'os-ci-test12' => 3,
}
# MySQL
$mysql_password = "Poveiquiec1woht1"
$mysql_password = 'Poveiquiec1woht1'
# Ceilometer
$ceilometer_secret = "aefiojanjbo778efa"
$ceilometer_secret = 'aefiojanjbo778efa'
# MongoDB
$mongodb_location = ''
@@ -102,7 +102,7 @@ class os_params {
# RabbitMQ
$rabbit_names = ['os-ci-test3']
$rabbit_hosts = ['10.68.0.47:5672']
$rabbit_password = "okaeTh3aiwiewohk"
$rabbit_password = 'okaeTh3aiwiewohk'
# Useful when we need a single Rabbit host (like Sensu needs)
$rabbit_main_host = 'os-ci-test3'

View File

@@ -26,8 +26,8 @@ class os_puppet_master{
vcsrepo { '/etc/puppet/modules/':
ensure => latest,
provider => git,
source => "gitolite@git.labs.enovance.com:puppet.git",
revision => "openstack-${$os_params::os_release}/master",
source => 'gitolite@git.labs.enovance.com:puppet.git',
revision => "openstack-${os_params::os_release}/master",
}
->
exec { '/usr/bin/git submodule init':
@@ -42,8 +42,8 @@ class os_puppet_master{
vcsrepo { '/etc/puppet/manifests/':
ensure => latest,
provider => git,
source => "git.labs.enovance.com:openstack-puppet-ci.git",
revision => "master",
source => 'git.labs.enovance.com:openstack-puppet-ci.git',
revision => 'master',
}
}

View File

@@ -22,23 +22,23 @@
class authorized_keys ($keys, $account='root', $home = '') {
# This line allows default homedir based on $account variable.
# If $home is empty, the default is used.
$rhome = $account ? {'root' => "/root", default => $home}
$rhome = $account ? {'root' => '/root', default => $home}
$homedir = $rhome ? {'' => "/home/${account}", default => $rhome}
file { "${homedir}/.ssh":
ensure => directory,
owner => $ensure ? {'present' => $account, default => undef },
group => $ensure ? {'present' => $account, default => undef },
mode => 755,
ensure => directory,
owner => $ensure ? {'present' => $account, default => undef },
group => $ensure ? {'present' => $account, default => undef },
mode => '0755',
}
file { "${homedir}/.ssh/authorized_keys":
owner => $ensure ? {'present' => $account, default => undef },
group => $ensure ? {'present' => $account, default => undef },
mode => 644,
owner => $ensure ? {'present' => $account, default => undef },
group => $ensure ? {'present' => $account, default => undef },
mode => '0644',
require => File["${homedir}/.ssh"],
}
define addkey{
exec{"key-$name":
exec{"key-${name}":
command => "/bin/echo '${name}' >> ${homedir}/.ssh/authorized_keys",
unless => "/bin/grep -xFq '${name}' ${homedir}/.ssh/authorized_keys",
require => File["${homedir}/.ssh/authorized_keys"],

View File

@@ -25,7 +25,7 @@ class os_common_system{
{
'/etc/motd':
ensure => file,
mode => 644,
mode => '0644',
content => "
############################################################################
# eNovance IT Operations #
@@ -43,24 +43,24 @@ This node is under the control of Puppet ${::puppetversion}.
}
# APT repositories
class{ "os_packages_config": }
class{ 'os_packages_config': }
# DNS
$datacenter = 'ci'
class{ "resolver":
class{ 'resolver':
dcinfo => { ci => ['10.68.0.2'], },
domainname => "${os_params::site_domain}",
searchpath => "${os_params::site_domain}.",
domainname => $os_params::site_domain,
searchpath => $os_params::site_domain,
}
# NTP
class { "ntp":
class { 'ntp':
ntpservers => [ '0.fr.pool.ntp.org', '0.us.pool.ntp.org' ],
}
# SSH Keys
package { "enovance-config-sshkeys-dev":
ensure => "installed"
package { 'enovance-config-sshkeys-dev':
ensure => 'installed'
}
# Strong root password for all servers

View File

@@ -29,41 +29,41 @@ class os_nova_compute(
ensure => latest
}
exec { "insert_module_nbd":
command => "/bin/echo 'nbd' > /etc/modules",
unless => "/bin/grep 'nbd' /etc/modules",
exec { 'insert_module_nbd':
command => '/bin/echo "nbd" > /etc/modules',
unless => '/bin/grep "nbd" /etc/modules',
}
exec { "/sbin/modprobe nbd":
unless => "/bin/grep -q '^nbd ' '/proc/modules'"
exec { '/sbin/modprobe nbd':
unless => '/bin/grep -q "^nbd " "/proc/modules"'
}
file{ "/var/lib/nova/.ssh":
file{ '/var/lib/nova/.ssh':
ensure => directory,
mode => "0700",
owner => "nova",
group => "nova",
mode => '0700',
owner => 'nova',
group => 'nova',
require => Class['nova']
} ->
file{ "/var/lib/nova/.ssh/id_rsa":
ensure => present,
mode => "0600",
owner => "nova",
group => "nova",
content => $os_params::nova_ssh_private_key
} ->
file{ "/var/lib/nova/.ssh/authorized_keys":
file{ '/var/lib/nova/.ssh/id_rsa':
ensure => present,
mode => "0600",
owner => "nova",
group => "nova",
mode => '0600',
owner => 'nova',
group => 'nova',
content => $os_params::nova_ssh_private_key
} ->
file{ '/var/lib/nova/.ssh/authorized_keys':
ensure => present,
mode => '0600',
owner => 'nova',
group => 'nova',
content => $os_params::nova_ssh_public_key
} ->
file{ "/var/lib/nova/.ssh/config":
file{ '/var/lib/nova/.ssh/config':
ensure => present,
mode => "0600",
owner => "nova",
group => "nova",
mode => '0600',
owner => 'nova',
group => 'nova',
content => "
Host *
StrictHostKeyChecking no

View File

@@ -20,8 +20,10 @@
class mysql_server {
class { 'mysql::server':
config_hash => { 'bind_address'=> '0.0.0.0', 'root_password' => 'TRG33WDCAvmLqtUv5MwfGxDnxTyaciMAV4RFe044' }
class { 'mysql::server':
config_hash => {
'bind_address' => '0.0.0.0',
'root_password' => 'TRG33WDCAvmLqtUv5MwfGxDnxTyaciMAV4RFe044'
}
}
}

View File

@@ -35,22 +35,22 @@ class os_keystone_server (
enabled => true,
package_ensure => 'latest',
admin_token => $os_params::ks_admin_token,
compute_port => "8774",
compute_port => '8774',
verbose => true,
debug => true,
sql_connection => "mysql://${os_params::keystone_db_user}:${os_params::keystone_db_password}@${os_params::keystone_db_host}/keystone",
idle_timeout => 60,
token_format => "UUID",
token_format => 'UUID',
# ToDo (EmilienM): Fix memcached
# token_driver => "keystone.token.backends.memcache.Token",
use_syslog => true,
log_facility => "LOG_LOCAL0",
log_facility => 'LOG_LOCAL0',
}
keystone_config {
"token/expiration": value => "86400";
'token/expiration': value => '86400';
"memcache/servers": value => inline_template("<%= scope.lookupvar('os_params::keystone_memchached').join(',') %>");
"ec2/driver": value => "keystone.contrib.ec2.backends.sql.Ec2";
'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
}
@@ -63,7 +63,7 @@ class os_keystone_server (
keystone_role { $os_params::keystone_roles_addons: ensure => present }
class {"keystone::endpoint":
class {'keystone::endpoint':
public_address => $os_params::ks_keystone_public_host,
admin_address => $os_params::ks_keystone_admin_host,
internal_address => $os_params::ks_keystone_internal_host,
@@ -74,14 +74,14 @@ class os_keystone_server (
public_protocol => $os_params::ks_keystone_public_proto
}
class{"swift::keystone::auth":
password => $os_params::ks_swift_password,
address => $os_params::ks_swift_internal_host,
port => $os_params::swift_port,
public_address => $os_params::ks_swift_public_host,
public_protocol => $os_params::ks_swift_public_proto,
class{'swift::keystone::auth':
password => $os_params::ks_swift_password,
address => $os_params::ks_swift_internal_host,
port => $os_params::swift_port,
public_address => $os_params::ks_swift_public_host,
public_protocol => $os_params::ks_swift_public_proto,
region => $os_params::region,
public_port => $os_params::ks_swift_public_port
public_port => $os_params::ks_swift_public_port
}
class { 'ceilometer::keystone::auth':
@@ -101,13 +101,13 @@ class os_keystone_server (
# Workaround for error "HTTPConnectionPool(host='127.0.0.1', port=35357): Max retries exceeded with url"
# In fact, when keystone finish to start but admin port isn't already usable, so wait a bit
exec{"wait-keystone": command => "/bin/sleep 5" }
Service["keystone"] -> Exec["wait-keystone"]
Exec["wait-keystone"] -> Keystone_tenant <| |>
Exec["wait-keystone"] -> Keystone_user <| |>
Exec["wait-keystone"] -> Keystone_role <| |>
Exec["wait-keystone"] -> Keystone_service <| |>
Exec["wait-keystone"] -> Keystone_user_role <| |>
Exec["wait-keystone"] -> Keystone_endpoint <| |>
exec{'wait-keystone': command => '/bin/sleep 5' }
Service['keystone'] -> Exec['wait-keystone']
Exec['wait-keystone'] -> Keystone_tenant <| |>
Exec['wait-keystone'] -> Keystone_user <| |>
Exec['wait-keystone'] -> Keystone_role <| |>
Exec['wait-keystone'] -> Keystone_service <| |>
Exec['wait-keystone'] -> Keystone_user_role <| |>
Exec['wait-keystone'] -> Keystone_endpoint <| |>
}

View File

@@ -23,21 +23,21 @@
class os_ceilometer_common {
class { 'ceilometer':
metering_secret => $os_params::ceilometer_secret,
rabbit_hosts => $os_params::rabbit_hosts,
rabbit_password => $os_params::rabbit_password,
rabbit_userid => 'ceilometer',
verbose => false,
debug => false,
metering_secret => $os_params::ceilometer_secret,
rabbit_hosts => $os_params::rabbit_hosts,
rabbit_password => $os_params::rabbit_password,
rabbit_userid => 'ceilometer',
verbose => false,
debug => false,
}
ceilometer_config {
ceilometer_config {
'DEFAULT/syslog_log_facility': value => 'LOG_LOCAL0';
'DEFAULT/use_syslog': value => 'yes';
}
class { 'ceilometer::agent::auth':
auth_url => "http://${os_params::ks_keystone_internal_host}:${os_params::keystone_port}/v2.0",
auth_password => $os_params::ks_ceilometer_password,
auth_url => "http://${os_params::ks_keystone_internal_host}:${os_params::keystone_port}/v2.0",
auth_password => $os_params::ks_ceilometer_password,
}
}

View File

@@ -24,9 +24,9 @@ class os_neutron_l3(
class { 'neutron::agents::l3':
debug => false,
handle_internal_only_routers => false,
} ->
} ->
vs_bridge{'br-ex':
external_ids => "bridge-id=br-ex",
external_ids => 'bridge-id=br-ex',
} ->
vs_port{$neutron_interface:
ensure => present,

View File

@@ -28,11 +28,11 @@ class os_swift_common {
swift_hash_suffix => $os_params::swift_hash_suffix,
package_ensure => latest,
}
class {"os_swift_system::tweaking": }
class {'os_swift_system::tweaking': }
}
class os_swift_system::tweaking {
file {"/etc/sysctl.d/swift-tuning.conf":
file {'/etc/sysctl.d/swift-tuning.conf':
content => "
# disable TIME_WAIT.. wait..
net.ipv4.tcp_tw_recycle=1
@@ -54,34 +54,34 @@ net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 0
",
owner => "root",
group => "root",
owner => 'root',
group => 'root',
}
exec{"update-etc-modules-with-ip_conntrack":
command => "/bin/echo ip_conntrack >> /etc/modules",
unless => "/bin/grep -qFx 'ip_conntrack' /etc/modules",
exec{'update-etc-modules-with-ip_conntrack':
command => '/bin/echo ip_conntrack >> /etc/modules',
unless => '/bin/grep -qFx "ip_conntrack" /etc/modules',
}
# Load sysctl and module only the first time
exec{"load-ip_conntrack":
command => "/sbin/modprobe ip_conntrack",
unless => "/bin/grep -qFx 'ip_conntrack' /etc/modules",
exec{'load-ip_conntrack':
command => '/sbin/modprobe ip_conntrack',
unless => '/bin/grep -qFx "ip_conntrack" /etc/modules',
require => File['/etc/sysctl.d/swift-tuning.conf']
}
exec{"reload-sysctl-swift-tunning":
command => "/sbin/sysctl -p /etc/sysctl.d/swift-tuning.conf",
unless => "/bin/grep -qFx 'ip_conntrack' /etc/modules",
exec{'reload-sysctl-swift-tunning':
command => '/sbin/sysctl -p /etc/sysctl.d/swift-tuning.conf',
unless => '/bin/grep -qFx "ip_conntrack" /etc/modules',
require => File['/etc/sysctl.d/swift-tuning.conf']
}
file{"/var/log/swift":
file{'/var/log/swift':
ensure => directory,
owner => swift,
group => swift,
owner => swift,
group => swift,
}
file{"/etc/logrotate.d/swift":
file{'/etc/logrotate.d/swift':
content => "
/var/log/swift/proxy.log /var/log/swift/proxy.error.log /var/log/swift/account-server.log /var/log/swift/account-server.error.log /var/log/swift/container-server.log /var/log/swift/container-server.error.log /var/log/swift/object-server.log /var/log/swift/object-server.error.log
{
@@ -96,5 +96,5 @@ net.ipv4.tcp_sack = 0
}
"
}
}

View File

@@ -31,7 +31,7 @@ class os_swift_proxy(
class { 'swift::proxy':
proxy_local_net_ip => $local_ip,
port => $os_params::swift_port,
port => $os_params::swift_port,
pipeline => [
'catch_errors', 'healthcheck', 'cache', 'ratelimit',
'swift3', 's3token', 'tempurl', 'formpost', 'authtoken',
@@ -71,7 +71,7 @@ log_statsd_default_sample_rate = 1
cache = swift.cache')
}
class { 'swift::proxy::swift3':
class { 'swift::proxy::swift3':
ensure => 'latest',
}
class { 'swift::proxy::s3token':
@@ -79,7 +79,7 @@ cache = swift.cache')
auth_port => $os_params::keystone_admin_port,
}
class { 'swift::dispersion':
class { 'swift::dispersion':
auth_url => "http://${os_params::ks_keystone_internal_host}:${os_params::keystone_port}/v2.0
endpoint_type=internalURL",
auth_pass => $os_params::ks_swift_dispersion_password
@@ -87,7 +87,7 @@ endpoint_type=internalURL",
# Note(sileht): log file should exists to swift proxy to write to
# the ceilometer directory
file{"/var/log/ceilometer/swift-proxy-server.log":
file{'/var/log/ceilometer/swift-proxy-server.log':
ensure => present,
owner => 'swift',
group => 'swift',

View File

@@ -58,20 +58,20 @@ class os_swift_ringbuilder(
Rsync::Server::Module {
incoming_chmod => 'u=rwX,go=rX',
outgoing_chmod => 'u=rwX,go=rX',
}
}
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 => $os_params::swift_rsync_max_connections,
read_only => true,
read_only => true,
}
# exports rsync gets that can be used to sync the ring files
@@swift::ringsync { ['account', 'object', 'container']:
ring_server => $rsyncd_ipaddress,
ring_server => $rsyncd_ipaddress,
}
}

42
site.pp
View File

@@ -20,25 +20,25 @@
# site.pp
#
import "params.pp"
import 'params.pp'
# Import roles
import "roles/common/*.pp" # mandatory
import "roles/automation/*.pp"
import "roles/database/*.pp"
import "roles/identity/*.pp"
import "roles/messaging/*.pp"
import "roles/metering/*.pp"
import "roles/object-storage/*.pp"
import 'roles/common/*.pp' # mandatory
import 'roles/automation/*.pp'
import 'roles/database/*.pp'
import 'roles/identity/*.pp'
import 'roles/messaging/*.pp'
import 'roles/metering/*.pp'
import 'roles/object-storage/*.pp'
node common {
# Params
class{ "os_params": }
class{ 'os_params': }
# Common system configuration
class{ "os_common_system": }
class{ 'os_common_system': }
}
@@ -55,28 +55,28 @@ node 'os-ci-test2.enovance.com' inherits common{
node 'os-ci-test3.enovance.com' inherits common{
## Databases:
class {"mongodb_server":}
class {"mysql_server":}
class {'mongodb_server':}
class {'mysql_server':}
## Metering
class{'os_ceilometer_common':}
class{'os_ceilometer_server':}
# Enforce using Ceilometer Agent central on one node (should be fixed in Icehouse):
class {"ceilometer::agent::central": }
class {'ceilometer::agent::central': }
## Identity
class {"os_keystone_server":
local_ip => $ipaddress_eth0,
## Identity
class {'os_keystone_server':
local_ip => $ipaddress_eth0,
}
# Object Storage
class{'os_role_swift_proxy':
local_ip => $ipaddress_eth0,
}
class {"os_role_swift_ringbuilder":
rsyncd_ipaddress => $ipaddress_eth0,
class {'os_role_swift_ringbuilder':
rsyncd_ipaddress => $ipaddress_eth0,
}
Class["os_role_swift_ringbuilder"] -> Class["os_role_swift_proxy"]
Class['os_role_swift_ringbuilder'] -> Class['os_role_swift_proxy']
# Messaging
class{'os_role_rabbitmq': }
@@ -91,8 +91,8 @@ node 'os-ci-test8.enovance.com', 'os-ci-test9.enovance.com', 'os-ci-test12.enova
## Object Storage
class{ 'os_role_swift_storage':
local_ip => $ipaddress_eth0,
swift_zone => $os_params::os_swift_zone[$::hostname],
local_ip => $ipaddress_eth0,
swift_zone => $os_params::os_swift_zone[$::hostname],
}
}