From ee06a743dd16eef2ff2d9827eb1305ed2c07c011 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Sat, 18 Jun 2011 23:05:48 -0700 Subject: [PATCH 1/3] Fixed dependency/order issues. all nova services are started after nova.conf is configured db and rabbitmq should be configured before nova.conf Basically using nova_config as an anchor network should only be started after nova-compute service is started. --- manifests/api.pp | 2 ++ manifests/compute.pp | 5 +++-- manifests/db.pp | 3 +++ manifests/network.pp | 3 +++ manifests/objectstore.pp | 2 ++ manifests/rabbitmq.pp | 6 +++++- manifests/scheduler.pp | 2 ++ 7 files changed, 20 insertions(+), 3 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 66a7f75b2..9e1309803 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -1,5 +1,7 @@ class nova::api($enabled=false) inherits nova { + Nova_config<| |> ~> Service['nova-api'] + if $enabled { $service_ensure = 'running' } else { diff --git a/manifests/compute.pp b/manifests/compute.pp index 467bfabff..2123caba7 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -8,7 +8,7 @@ class nova::compute( $libvirt_type = 'kvm' ) { - Nova_config<| |>~>Service['nova-compute'] + Nova_config<| |> ~> Service['nova-compute'] nova_config { 'libvirt_type': value => $libvirt_type } @@ -20,13 +20,14 @@ class nova::compute( package { "nova-compute": ensure => present, - require => Class['nova'], + require => Package['nova-common'], } service { "nova-compute": ensure => $service_ensure, enable => $enabled, require => Package["nova-compute"], + before => Exec['networking-refresh'], } # forward guest metadata requests to correct API server diff --git a/manifests/db.pp b/manifests/db.pp index f81a86bbc..5a0d8445a 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -6,6 +6,9 @@ class nova::db( $cluster_id = 'localzone' ) { + # only start configuring nova after the database is setup + Mysql::Db[$name] -> Nova_config<| |> + # now this requires storedconfigs # TODO - worry about the security implications @@nova_config { 'database_url': diff --git a/manifests/network.pp b/manifests/network.pp index 0df3f0dfa..5f9903f13 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -1,5 +1,7 @@ class nova::network( $enabled=false ) inherits nova { + Nova_config<| |> ~> Service['nova-network'] + if $enabled { $service_ensure = 'running' } else { @@ -15,6 +17,7 @@ class nova::network( $enabled=false ) inherits nova { ensure => $service_ensure, enable => $enabled, require => Package["nova-network"], + before => Exec['networking-refresh'], #subscribe => File["/etc/nova/nova.conf"] } } diff --git a/manifests/objectstore.pp b/manifests/objectstore.pp index 11ec4c325..0be849e52 100644 --- a/manifests/objectstore.pp +++ b/manifests/objectstore.pp @@ -1,5 +1,7 @@ class nova::objectstore( $enabled=false ) inherits nova { + Nova_config<| |> ~> Service['nova-objectstore'] + if $enabled { $service_ensure = 'running' } else { diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp index 0a41852fe..3d52364ef 100644 --- a/manifests/rabbitmq.pp +++ b/manifests/rabbitmq.pp @@ -9,6 +9,10 @@ class nova::rabbitmq( $virtual_host='/', $install_repo = false ) { + + # only configure nova after the queue is up + Class['rabbitmq::service'] -> Nova_config<| |> + if $install_repo { # this is debian specific class { 'rabbitmq::repo::apt': @@ -32,7 +36,7 @@ class nova::rabbitmq( write_permission => '.*', read_permission => '.*', provider => 'rabbitmqctl', - } + }->Nova_config<| |> } class { 'rabbitmq::server': port => $port, diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp index 8d8342be8..3a183c3e4 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -1,5 +1,7 @@ class nova::scheduler( $enabled ) inherits nova { + Nova_config<| |> ~> Service['nova-scheduler'] + if $enabled { $service_ensure = 'running' } else { From c1afee600dd5aae06e9ecd3ba4743e6fac7d3340 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Sat, 18 Jun 2011 23:09:54 -0700 Subject: [PATCH 2/3] Removed class inheritence. It wasnt doing anything. --- manifests/api.pp | 2 +- manifests/network.pp | 2 +- manifests/objectstore.pp | 2 +- manifests/scheduler.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 9e1309803..92c6d5e86 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -1,4 +1,4 @@ -class nova::api($enabled=false) inherits nova { +class nova::api($enabled=false) { Nova_config<| |> ~> Service['nova-api'] diff --git a/manifests/network.pp b/manifests/network.pp index 5f9903f13..761941a95 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -1,4 +1,4 @@ -class nova::network( $enabled=false ) inherits nova { +class nova::network( $enabled=false ) { Nova_config<| |> ~> Service['nova-network'] diff --git a/manifests/objectstore.pp b/manifests/objectstore.pp index 0be849e52..4072b04e5 100644 --- a/manifests/objectstore.pp +++ b/manifests/objectstore.pp @@ -1,4 +1,4 @@ -class nova::objectstore( $enabled=false ) inherits nova { +class nova::objectstore( $enabled=false ) { Nova_config<| |> ~> Service['nova-objectstore'] diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp index 3a183c3e4..d79cb8d7f 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -1,4 +1,4 @@ -class nova::scheduler( $enabled ) inherits nova { +class nova::scheduler( $enabled ) { Nova_config<| |> ~> Service['nova-scheduler'] From deb76699f8a3fc0154855b8185074d48e087b817 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Sat, 18 Jun 2011 23:10:09 -0700 Subject: [PATCH 3/3] cleanup up all.pp test. --- tests/all.pp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/all.pp b/tests/all.pp index 41c5da5f5..606e7f216 100644 --- a/tests/all.pp +++ b/tests/all.pp @@ -1,18 +1,6 @@ resources { 'nova_config': purge => true, } - -stage { 'repo-setup': - before => Stage['main'], -} -#class { 'apt': -# disable_keys => true, -# #always_apt_update => true, -# stage => 'repo-setup', -#} -#class { 'nova::repo': -# stage => 'repo-setup', -#} class { 'mysql::server': } class { 'nova::all': db_password => 'password',