Puppet lint

Change-Id: Ia95da80607a05f228aec9cce6468f75aef0a4711
This commit is contained in:
Mathieu Gagné 2013-05-08 18:09:29 -04:00
parent 8487b41c21
commit 65eb7a500c
24 changed files with 120 additions and 114 deletions

View File

@ -144,13 +144,13 @@ class { 'nova::network':
enabled => true
}
nova::manage::network { "nova-vm-net":
nova::manage::network { 'nova-vm-net':
network => '11.0.0.0/24',
available_ips => 128,
}
nova::manage::floating { "nova-vm-floating":
network => '10.128.0.0/24',
nova::manage::floating { 'nova-vm-floating':
network => '10.128.0.0/24',
}
class { 'nova::objectstore':

View File

@ -167,20 +167,20 @@ node /controller/ {
enabled => true,
}
nova::manage::network { "nova-vm-net":
nova::manage::network { 'nova-vm-net':
network => '11.0.0.0/24',
available_ips => 128,
}
nova::manage::floating { "nova-vm-floating":
network => '10.128.0.0/24',
nova::manage::floating { 'nova-vm-floating':
network => '10.128.0.0/24',
}
class { 'nova::objectstore':
enabled => true
}
class { 'nova::volume':
class { 'nova::volume':
enabled => true,
}

View File

@ -27,10 +27,8 @@ file { '/usr/lib/ruby/1.8/facter/ec2.rb':
node db {
class { 'mysql::server':
config_hash => {
'bind_address' => '0.0.0.0'
#'root_password' => 'foo',
#'etc_root_password' => true
}
'bind_address' => '0.0.0.0'
}
}
class { 'mysql::ruby': }
class { 'nova::db::mysql':
@ -45,21 +43,21 @@ node db {
node controller {
class { 'nova::controller':
db_password => $db_password,
db_name => $db_name,
db_user => $db_username,
db_host => $db_host,
db_password => $db_password,
db_name => $db_name,
db_user => $db_username,
db_host => $db_host,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_user,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_user,
rabbit_virtual_host => $rabbit_vhost,
rabbit_hosts => $rabbit_hosts,
rabbit_hosts => $rabbit_hosts,
image_service => 'nova.image.glance.GlanceImageService',
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_api_servers,
glance_api_servers => $glance_api_servers,
libvirt_type => 'qemu',
libvirt_type => 'qemu',
}
}
@ -76,7 +74,7 @@ node compute {
flat_network_bridge_ip => '11.0.0.1',
flat_network_bridge_netmask => '255.255.255.0',
}
class { "nova":
class { 'nova':
verbose => $verbose,
sql_connection => "mysql://${db_username}:${db_password}@${db_host}/${db_name}",
image_service => 'nova.image.glance.GlanceImageService',
@ -127,7 +125,7 @@ node puppetmaster {
version => installed,
puppet_master_package => 'puppet',
package_provider => 'gem',
autosign => 'true',
autosign => true,
certname => $clientcert,
}
}
@ -152,20 +150,20 @@ node all {
class { 'keystone::roles::admin': }
class { 'nova::all':
db_password => 'password',
db_name => 'nova',
db_user => 'nova',
db_host => 'localhost',
db_password => 'password',
db_name => 'nova',
db_user => 'nova',
db_host => 'localhost',
rabbit_password => 'rabbitpassword',
rabbit_userid => 'rabbit_user',
rabbit_password => 'rabbitpassword',
rabbit_userid => 'rabbit_user',
rabbit_virtual_host => '/',
rabbit_hosts => ['localhost:5672'],
rabbit_hosts => ['localhost:5672'],
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_api_servers,
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_api_servers,
libvirt_type => 'qemu',
libvirt_type => 'qemu',
}
}

View File

@ -42,8 +42,8 @@ class nova::api(
Nova_paste_api_ini<| |> ~> Exec['post-nova_config']
Nova_paste_api_ini<| |> ~> Service['nova-api']
class {'cinder::client':
notify => Service[$::nova::params::api_service_name],
class { 'cinder::client':
notify => Service[$::nova::params::api_service_name],
}
nova::generic_service { 'api':
@ -88,30 +88,31 @@ class nova::api(
if 'occiapi' in $enabled_apis {
if !defined(Package['python-pip']) {
package {'python-pip':
ensure => latest,
}
package { 'python-pip':
ensure => latest,
}
}
if !defined(Package['pyssf']){
package {'pyssf':
provider => pip,
ensure => latest,
require => Package['python-pip']
}
if !defined(Package['pyssf']) {
package { 'pyssf':
provider => pip,
ensure => latest,
require => Package['python-pip']
}
}
package { 'openstackocci' :
provider => 'pip',
ensure => latest,
require => Package['python-pip'],
package { 'openstackocci':
provider => 'pip',
ensure => latest,
require => Package['python-pip'],
}
}
# Added arg and if statement prevents this from being run where db is not active i.e. the compute
# Added arg and if statement prevents this from being run
# where db is not active i.e. the compute
if $sync_db {
Package<| title == 'nova-api' |> -> Exec['nova-db-sync']
exec { "nova-db-sync":
command => "/usr/bin/nova-manage db sync",
refreshonly => "true",
exec { 'nova-db-sync':
command => '/usr/bin/nova-manage db sync',
refreshonly => true,
subscribe => Exec['post-nova_config'],
}
}

View File

@ -1,6 +1,6 @@
#schedulee this class should probably never be declared except
# from the virtualization implementation of the compute node
class nova::compute(
class nova::compute (
$enabled = false,
$ensure_package = 'present',
$vnc_enabled = true,
@ -10,7 +10,7 @@ class nova::compute(
$vncproxy_port = '6080',
$vncproxy_path = '/vnc_auto.html',
$virtio_nic = false
) {
) {
include nova::params
@ -25,7 +25,7 @@ class nova::compute(
}
nova_config {
'DEFAULT/vnc_enabled': value => $vnc_enabled;
'DEFAULT/vnc_enabled': value => $vnc_enabled;
'DEFAULT/vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
}
@ -44,7 +44,7 @@ class nova::compute(
if $virtio_nic {
# Enable the virtio network card for instances
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => 'True' }
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => true }
}
}

View File

@ -21,7 +21,7 @@ class nova::compute::file_hack() {
notify => Service['nova-compute'],
}
file { '/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py':
file { '/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py':
source => 'puppet:///modules/nova/connection.py',
}

View File

@ -1,3 +1,4 @@
#
class nova::compute::libvirt (
$libvirt_type = 'kvm',
$vncserver_listen = '127.0.0.1',

View File

@ -1,6 +1,7 @@
#
class nova::compute::quantum (
$libvirt_vif_driver = 'nova.virt.libvirt.vif.LibvirtOpenVswitchDriver'
){
) {
nova_config {
'DEFAULT/libvirt_vif_driver': value => $libvirt_vif_driver;

View File

@ -1,3 +1,4 @@
#
class nova::compute::xenserver(
$xenapi_connection_url,
$xenapi_connection_username,

View File

@ -3,17 +3,17 @@
#
class nova::db::mysql(
$password,
$dbname = 'nova',
$user = 'nova',
$host = '127.0.0.1',
$charset = 'latin1',
$dbname = 'nova',
$user = 'nova',
$host = '127.0.0.1',
$charset = 'latin1',
$allowed_hosts = undef,
$cluster_id = 'localzone'
$cluster_id = 'localzone'
) {
require 'mysql::python'
# Create the db instance before openstack-nova if its installed
Mysql::Db[$dbname] -> Anchor<| title == "nova-start" |>
Mysql::Db[$dbname] -> Anchor<| title == 'nova-start' |>
Mysql::Db[$dbname] ~> Exec<| title == 'nova-db-sync' |>
mysql::db { $dbname:
@ -21,7 +21,6 @@ class nova::db::mysql(
password => $password,
host => $host,
charset => $charset,
# I may want to inject some sql
require => Class['mysql::config'],
}

View File

@ -2,13 +2,13 @@
define nova::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}"]
}
}

View File

@ -10,13 +10,13 @@ class nova::db::postgresql(
require 'postgresql::python'
Postgresql::Db[$dbname] -> Anchor<| title == "nova-start" |>
Postgresql::Db[$dbname] -> Anchor<| title == 'nova-start' |>
Postgresql::Db[$dbname] ~> Exec<| title == 'nova-db-sync' |>
Package['python-psycopg2'] -> Exec<| title == 'nova-db-sync' |>
postgresql::db { "${dbname}":
user => "${user}",
password => "${password}",
postgresql::db { $dbname:
user => $user,
password => $password,
}
}

View File

@ -91,7 +91,7 @@ class nova(
ensure => present,
}
package { 'python-greenlet':
ensure => present,
ensure => present,
require => Package['python'],
}
@ -109,7 +109,7 @@ class nova(
package { 'nova-common':
name => $::nova::params::common_package_name,
ensure => $ensure_package,
require => [Package["python-nova"], Anchor['nova-start']]
require => [Package['python-nova'], Anchor['nova-start']]
}
group { 'nova':
@ -134,9 +134,9 @@ class nova(
# used by debian/ubuntu in nova::network_bridge to refresh
# interfaces based on /etc/network/interfaces
exec { "networking-refresh":
command => "/sbin/ifdown -a ; /sbin/ifup -a",
refreshonly => "true",
exec { 'networking-refresh':
command => '/sbin/ifdown -a ; /sbin/ifup -a',
refreshonly => true,
}
@ -182,8 +182,8 @@ class nova(
if $rabbit_hosts {
nova_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
} elsif $rabbit_host {
nova_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
nova_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
nova_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
nova_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
nova_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
}
}
@ -215,7 +215,7 @@ class nova(
'DEFAULT/state_path': value => $state_path;
'DEFAULT/lock_path': value => $lock_path;
'DEFAULT/service_down_time': value => $service_down_time;
'DEFAULT/rootwrap_config': value => $rootwrap_config;
'DEFAULT/rootwrap_config': value => $rootwrap_config;
}
if $monitoring_notifications {
@ -225,7 +225,7 @@ class nova(
}
exec { 'post-nova_config':
command => '/bin/echo "Nova config has changed"',
command => '/bin/echo "Nova config has changed"',
refreshonly => true,
}

View File

@ -1,3 +1,4 @@
#
class nova::keystone::auth(
$password,
$auth_name = 'nova',
@ -30,7 +31,7 @@ class nova::keystone::auth(
keystone_service { $auth_name:
ensure => present,
type => 'compute',
description => "Openstack Compute Service",
description => 'Openstack Compute Service',
}
keystone_endpoint { "${region}/${auth_name}":
ensure => present,

View File

@ -1,12 +1,13 @@
#
define nova::manage::floating ( $network ) {
File['/etc/nova/nova.conf'] -> Nova_floating[$name]
Exec<| title == 'nova-db-sync' |> -> Nova_floating[$name]
nova_floating { $name:
ensure => present,
network => $network,
provider => 'nova_manage',
ensure => present,
network => $network,
provider => 'nova_manage',
}
}

View File

@ -1,3 +1,4 @@
#
class nova::migration::libvirt {
case $::lsbdistid {
@ -5,16 +6,16 @@ class nova::migration::libvirt {
# Ubuntu-specific, not Debian, due to upstart
file_line { '/etc/libvirt/libvirtd.conf listen_tls':
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tls = 0',
match => 'listen_tls =',
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tls = 0',
match => 'listen_tls =',
notify => Service['libvirt'],
}
file_line { '/etc/libvirt/libvirtd.conf listen_tcp':
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tcp = 1',
match => 'listen_tcp =',
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tcp = 1',
match => 'listen_tcp =',
notify => Service['libvirt'],
}
@ -36,7 +37,6 @@ class nova::migration::libvirt {
line => 'libvirtd_opts="-d -l"',
match => 'libvirtd_opts=',
}
}
}
}

View File

@ -68,7 +68,7 @@ class nova::network(
}
if $floating_range {
nova::manage::floating { 'nova-vm-floating':
network => $floating_range,
network => $floating_range,
}
}
}

View File

@ -1,10 +1,13 @@
# bridge.pp
define nova::network::bridge ( $ip, $netmask = "255.255.255.0" )
{
define nova::network::bridge (
$ip,
$netmask = '255.255.255.0'
) {
case $::operatingsystem {
'debian', 'ubuntu': {
$context = "/files/etc/network/interfaces"
$context = '/files/etc/network/interfaces'
augeas { "bridge_${name}":
context => $context,
changes => [
@ -16,7 +19,7 @@ define nova::network::bridge ( $ip, $netmask = "255.255.255.0" )
"set iface[. = '${name}']/netmask ${netmask}",
"set iface[. = '${name}']/bridge_ports none",
],
notify => Exec["networking-refresh"],
notify => Exec['networking-refresh'],
}
}

View File

@ -1,4 +1,4 @@
# flatdhcp.pp
#
class nova::network::flatdhcp (
$fixed_range,
$flat_interface = undef,
@ -20,7 +20,6 @@ class nova::network::flatdhcp (
'DEFAULT/fixed_range': value => $fixed_range;
'DEFAULT/flat_interface': value => $flat_interface;
'DEFAULT/flat_network_bridge': value => $flat_network_bridge;
#'flat_dhcp_start': value => $flat_dhcp_start;
'DEFAULT/force_dhcp_release': value => $force_dhcp_release;
'DEFAULT/flat_injected': value => $flat_injected;
'DEFAULT/dhcp_domain': value => $dhcp_domain;

View File

@ -1,3 +1,4 @@
#
class nova::objectstore(
$enabled = false,
$ensure_package = 'present'

View File

@ -3,11 +3,11 @@
#
#
class nova::qpid(
$enabled = true,
$user='guest',
$password='guest',
$file='/var/lib/qpidd/qpidd.sasldb',
$realm='OPENSTACK'
$enabled = true,
$user = 'guest',
$password = 'guest',
$file = '/var/lib/qpidd/qpidd.sasldb',
$realm = 'OPENSTACK'
) {
# only configure nova after the queue is up
@ -18,9 +18,9 @@ class nova::qpid(
qpid_user { $user:
password => $password,
file => $file,
realm => $realm,
provider => 'saslpasswd2',
file => $file,
realm => $realm,
provider => 'saslpasswd2',
require => Class['qpid::server'],
}
@ -29,7 +29,7 @@ class nova::qpid(
}
class { 'qpid::server':
service_ensure => $service_ensure
service_ensure => $service_ensure
}
}

View File

@ -21,7 +21,7 @@ class nova::rabbitmq(
rabbitmq_user { $userid:
admin => true,
password => $password,
provider => 'rabbitmqctl',
provider => 'rabbitmqctl',
require => Class['rabbitmq::server'],
}
# I need to figure out the appropriate permissions
@ -46,7 +46,7 @@ class nova::rabbitmq(
if ($enabled) {
rabbitmq_vhost { $virtual_host:
provider => 'rabbitmqctl',
require => Class['rabbitmq::server'],
require => Class['rabbitmq::server'],
}
}
}

View File

@ -8,7 +8,7 @@ class nova::utilities {
}
}
if $::osfamily == 'Debian' {
$pkgs=['unzip', 'screen', 'parted', 'curl', 'euca2ools']
$pkgs = ['unzip', 'screen', 'parted', 'curl', 'euca2ools']
nova::utilities::install{$pkgs:}
}
}

View File

@ -1,6 +1,6 @@
# Class: nova::volume::san
#
# This class assumes that you have already configured your
# This class assumes that you have already configured your
# volume group - either by another module or during the server
# provisioning
#