Deploy nova over Apache httpd
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 26 Sep 2016 07:58:36 +0000 (10:58 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Thu, 13 Oct 2016 05:18:50 +0000 (08:18 +0300)
This adds the necessary resources to the manifest to migrate nova
to run over httpd. The service name will be moved to t-h-t in a
subsequent commit, but since this patch depends on t-h-t, we try to
avoid circular dependencies of repos.

Change-Id: I91d430a3871672f90b0f885736f067ddae3c238c
Depends-On: I57fb20cf0d58b3376243ba4aeb04e995e7152ce3

manifests/profile/base/nova/api.pp

index 3c472c5..03706dc 100644 (file)
@@ -38,10 +38,26 @@ class tripleo::profile::base::nova::api (
   include ::tripleo::profile::base::nova
 
   if $step >= 4 or ($step >= 3 and $sync_db) {
+
+    # Manages the migration to Nova API in mod_wsgi with Apache.
+    # - First update nova.conf with new parameters
+    # - Stop nova-api process before starting apache to avoid binding error
+    # - Start apache after configuring all vhosts
+    exec { 'stop_nova-api':
+      command     => 'service openstack-nova-api stop',
+      path        => ['/usr/bin', '/usr/sbin'],
+      onlyif      => 'systemctl is-active openstack-nova-api',
+      refreshonly => true,
+    }
+    Nova_config<||> ~> Exec['stop_nova-api']
+    Exec['stop_nova-api'] -> Service['httpd']
+
     class { '::nova::api':
-      sync_db     => $sync_db,
-      sync_db_api => $sync_db,
+      service_name => 'httpd', # Temporary: will be moved to t-h-t
+      sync_db      => $sync_db,
+      sync_db_api  => $sync_db,
     }
+    include ::nova::wsgi::apache
     include ::nova::network::neutron
   }