Enable nova-api as a composable service
authorEmilien Macchi <emilien@redhat.com>
Mon, 6 Jun 2016 16:17:19 +0000 (12:17 -0400)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Tue, 14 Jun 2016 09:00:56 +0000 (12:00 +0300)
Implement NovaApi service using nova-base for common parameters.

Change-Id: Ibcb89b332ab73f18d05e5b2e454964e322b982e6
Implements: blueprint composable-services-within-roles
Depends-On: I1dde63a5a7d1624494a7157a9679f88f4cb780e0

environments/puppet-pacemaker.yaml
overcloud-resource-registry-puppet.yaml
overcloud.yaml
puppet/controller.yaml
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp
puppet/services/nova-api.yaml [new file with mode: 0644]
puppet/services/pacemaker/nova-api.yaml [new file with mode: 0644]

index 00e14fd..a919c3c 100644 (file)
@@ -31,3 +31,4 @@ resource_registry:
   OS::TripleO::Services::Redis: ../puppet/services/pacemaker/database/redis.yaml
   OS::TripleO::Services::NovaConductor: ../puppet/services/pacemaker/nova-conductor.yaml
   OS::TripleO::Services::MongoDb: ../puppet/services/pacemaker/database/mongodb.yaml
+  OS::TripleO::Services::NovaApi: ../puppet/services/pacemaker/nova-api.yaml
index 3abd1c6..60be7dd 100644 (file)
@@ -148,6 +148,7 @@ resource_registry:
   OS::TripleO::Services::Redis: puppet/services/database/redis.yaml
   OS::TripleO::Services::NovaConductor: puppet/services/nova-conductor.yaml
   OS::TripleO::Services::MongoDb: puppet/services/database/mongodb.yaml
+  OS::TripleO::Services::NovaApi: puppet/services/nova-api.yaml
 
 parameter_defaults:
   EnablePackageInstall: false
index 5f0ad7d..2117b30 100644 (file)
@@ -590,6 +590,7 @@ parameters:
       - OS::TripleO::Services::Redis
       - OS::TripleO::Services::NovaConductor
       - OS::TripleO::Services::MongoDb
+      - OS::TripleO::Services::NovaApi
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the Controllers.
index 7ccd7e7..5bdfaec 100644 (file)
@@ -284,10 +284,6 @@ parameters:
     description: The password for the nova service and db account, used by nova-api.
     type: string
     hidden: true
-  NovaWorkers:
-    default: 0
-    description: Number of workers for Nova service.
-    type: number
   NtpServer:
     default: ''
     description: Comma-separated list of ntp servers
@@ -619,7 +615,6 @@ resources:
       input_values:
         bootstack_nodeid: {get_attr: [Controller, name]}
         ceilometer_workers: {get_param: CeilometerWorkers}
-        nova_workers: {get_param: NovaWorkers}
         haproxy_log_address: {get_param: HAProxySyslogAddress}
         haproxy_stats_password: {get_param: HAProxyStatsPassword}
         haproxy_stats_user: {get_param: HAProxyStatsUser}
@@ -1019,8 +1014,6 @@ resources:
                 nova::api::api_bind_address: {get_input: nova_api_network}
                 nova::api::metadata_listen: {get_input: nova_metadata_network}
                 nova::api::admin_password: {get_input: nova_password}
-                nova::api::osapi_compute_workers: {get_input: nova_workers}
-                nova::api::metadata_workers: {get_input: nova_workers}
                 nova::compute::network_device_mtu: {get_input: neutron_tenant_mtu}
                 nova::database_connection: {get_input: nova_dsn}
                 nova::api_database_connection: {get_input: nova_api_dsn}
index c6a8066..7bd9422 100644 (file)
@@ -151,7 +151,6 @@ if hiera('step') >= 4 {
     memcached_servers => $memcached_servers
   }
   include ::nova::config
-  include ::nova::api
   include ::nova::consoleauth
   include ::nova::network::neutron
   include ::nova::vncproxy
index d042bda..5510b4f 100644 (file)
@@ -350,12 +350,6 @@ MYSQL_HOST=localhost\n",
 
   include ::nova::config
 
-  class { '::nova::api' :
-    sync_db        => $sync_db,
-    sync_db_api    => $sync_db,
-    manage_service => false,
-    enabled        => false,
-  }
   class { '::nova::consoleauth' :
     manage_service => false,
     enabled        => false,
@@ -715,9 +709,6 @@ password=\"${mysql_root_password}\"",
     }
 
     # Nova
-    pacemaker::resource::service { $::nova::params::api_service_name :
-      clone_params => 'interleave=true',
-    }
     pacemaker::resource::service { $::nova::params::consoleauth_service_name :
       clone_params => 'interleave=true',
       require      => Pacemaker::Resource::Ocf['openstack-core'],
diff --git a/puppet/services/nova-api.yaml b/puppet/services/nova-api.yaml
new file mode 100644 (file)
index 0000000..f31df37
--- /dev/null
@@ -0,0 +1,31 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Nova API service configured with Puppet
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  NovaWorkers:
+    default: 0
+    description: Number of workers for Nova API service.
+    type: number
+
+resources:
+  NovaBase:
+    type: ./nova-base.yaml
+
+outputs:
+  role_data:
+    description: Role data for the Nova API service.
+    value:
+      config_settings:
+        map_merge:
+          - get_attr: [NovaBase, role_data, config_settings]
+          - nova::api::osapi_compute_workers: {get_param: NovaWorkers}
+          - nova::api::metadata_workers: {get_param: NovaWorkers}
+      step_config: |
+        include tripleo::profile::base::nova::api
diff --git a/puppet/services/pacemaker/nova-api.yaml b/puppet/services/pacemaker/nova-api.yaml
new file mode 100644 (file)
index 0000000..1b5011b
--- /dev/null
@@ -0,0 +1,30 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Nova API service with Pacemaker configured with Puppet.
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+
+resources:
+
+  NovaApiBase:
+    type: ../nova-api.yaml
+    properties:
+      EndpointMap: {get_param: EndpointMap}
+
+outputs:
+  role_data:
+    description: Role data for the Nova API role.
+    value:
+      config_settings:
+        map_merge:
+          - get_attr: [NovaApiBase, role_data, config_settings]
+          - nova::api::manage_service: false
+            nova::api::enabled: false
+      step_config: |
+        include ::tripleo::profile::pacemaker::nova::api