From 6c9cb5159bfaedc5fdf29d7ca096723fbe8f082b Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Tue, 8 May 2012 00:48:19 -0700 Subject: [PATCH] Improve db sync dependencies This commit adds a couple of dependencies related to db sync. Previously, it was possible that the nova-scheduler could be started before the db was synced. This would result in the service failing. This could only happen if none of the nova::manage::* defines were used. This commit adds a few extra dependencies to ensure that the initial db sync occurs before any services are started and also that the nova-db-sync call is only made after the nova-command package is installed and nova is configured to connect to the db. --- manifests/api.pp | 3 --- manifests/generic_service.pp | 1 + manifests/init.pp | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 681ff0cb8..8401b596b 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -14,9 +14,6 @@ class nova::api( $auth_uri = "${auth_protocol}://${auth_host}:${auth_port}/v2.0" - # TODO what exactly is this for? - # This resource is adding a great deal of comlexity to the overall - # modules. Removing it would be great exec { 'initial-db-sync': command => '/usr/bin/nova-manage db sync', refreshonly => true, diff --git a/manifests/generic_service.pp b/manifests/generic_service.pp index 3169b02e8..2a45e5f29 100644 --- a/manifests/generic_service.pp +++ b/manifests/generic_service.pp @@ -31,6 +31,7 @@ define nova::generic_service( Exec['post-nova_config'] ~> Service<| title == $nova_title |> # ensure that the service has only been started # after the initial db sync + Exec<| title == 'initial-db-sync' |> ~> Service<| title == $nova_title |> Exec['nova-db-sync'] ~> Service<| title == $nova_title |> diff --git a/manifests/init.pp b/manifests/init.pp index d31fa56c6..423486c7b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -120,6 +120,7 @@ class nova( exec { "nova-db-sync": command => "/usr/bin/nova-manage db sync", refreshonly => "true", + require => [Package['nova-common'], Nova_config['sql_connection']], } # used by debian/ubuntu in nova::network_bridge to refresh