diff --git a/examples/all.pp b/examples/all.pp index f49a879d6..d660e8860 100644 --- a/examples/all.pp +++ b/examples/all.pp @@ -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': diff --git a/examples/multi.pp b/examples/multi.pp index cdf8524cc..247587c3e 100644 --- a/examples/multi.pp +++ b/examples/multi.pp @@ -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, } diff --git a/examples/site.pp b/examples/site.pp index 37d807237..55438d810 100644 --- a/examples/site.pp +++ b/examples/site.pp @@ -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', } } diff --git a/manifests/api.pp b/manifests/api.pp index 4fb90bb43..62cbcda1d 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -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'], } } diff --git a/manifests/compute.pp b/manifests/compute.pp index 0a1c324db..61a2db5ce 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -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 } } } diff --git a/manifests/compute/file_hack.pp b/manifests/compute/file_hack.pp index 881e81050..63e6fdb8b 100644 --- a/manifests/compute/file_hack.pp +++ b/manifests/compute/file_hack.pp @@ -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', } diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 4b217b26b..413a9aa14 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -1,3 +1,4 @@ +# class nova::compute::libvirt ( $libvirt_type = 'kvm', $vncserver_listen = '127.0.0.1', diff --git a/manifests/compute/quantum.pp b/manifests/compute/quantum.pp index 15d04ef04..5e0066c92 100644 --- a/manifests/compute/quantum.pp +++ b/manifests/compute/quantum.pp @@ -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; diff --git a/manifests/compute/xenserver.pp b/manifests/compute/xenserver.pp index 6297e28ac..02653964d 100644 --- a/manifests/compute/xenserver.pp +++ b/manifests/compute/xenserver.pp @@ -1,3 +1,4 @@ +# class nova::compute::xenserver( $xenapi_connection_url, $xenapi_connection_username, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 5e0243038..567c40ae9 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -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'], } diff --git a/manifests/db/mysql/host_access.pp b/manifests/db/mysql/host_access.pp index 7e7f8cf6f..048be3f44 100644 --- a/manifests/db/mysql/host_access.pp +++ b/manifests/db/mysql/host_access.pp @@ -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}"] } } diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 00bb9a2bb..1330b14c5 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -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, } } diff --git a/manifests/init.pp b/manifests/init.pp index be0c813be..ae939a6be 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, } diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 8d7396142..55dcb5d5a 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -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, diff --git a/manifests/manage/floating.pp b/manifests/manage/floating.pp index 5afa71535..cff537c64 100644 --- a/manifests/manage/floating.pp +++ b/manifests/manage/floating.pp @@ -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', } } diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp index 554776ff9..f3fab5d00 100644 --- a/manifests/migration/libvirt.pp +++ b/manifests/migration/libvirt.pp @@ -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=', } - } } } diff --git a/manifests/network.pp b/manifests/network.pp index 4cc48c69c..b90aeefda 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -68,7 +68,7 @@ class nova::network( } if $floating_range { nova::manage::floating { 'nova-vm-floating': - network => $floating_range, + network => $floating_range, } } } diff --git a/manifests/network/bridge.pp b/manifests/network/bridge.pp index 865d19aea..6a20ae1ca 100644 --- a/manifests/network/bridge.pp +++ b/manifests/network/bridge.pp @@ -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'], } } diff --git a/manifests/network/flatdhcp.pp b/manifests/network/flatdhcp.pp index 541309b60..f03c04f33 100644 --- a/manifests/network/flatdhcp.pp +++ b/manifests/network/flatdhcp.pp @@ -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; diff --git a/manifests/objectstore.pp b/manifests/objectstore.pp index 68d428032..195bc97b7 100644 --- a/manifests/objectstore.pp +++ b/manifests/objectstore.pp @@ -1,3 +1,4 @@ +# class nova::objectstore( $enabled = false, $ensure_package = 'present' diff --git a/manifests/qpid.pp b/manifests/qpid.pp index e2ebe44a1..c3aa8937f 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -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 } } diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp index d68dfb968..3c2b48616 100644 --- a/manifests/rabbitmq.pp +++ b/manifests/rabbitmq.pp @@ -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'], } } } diff --git a/manifests/utilities.pp b/manifests/utilities.pp index 80582224a..d4f87b78f 100644 --- a/manifests/utilities.pp +++ b/manifests/utilities.pp @@ -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:} } } diff --git a/manifests/volume/san.pp b/manifests/volume/san.pp index 9fef0a3bd..1b17bc4b1 100644 --- a/manifests/volume/san.pp +++ b/manifests/volume/san.pp @@ -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 #