Run containerized mistral-api eventlet
authorMartin André <m.andre@redhat.com>
Wed, 18 Oct 2017 15:51:09 +0000 (17:51 +0200)
committerMichele Baldessari <michele@acksyn.org>
Thu, 26 Oct 2017 09:03:29 +0000 (09:03 +0000)
The mistral-api container image we use doesn't have the necessary
packages to run via wsgi and this cause puppet to error with:

  "Notice: /Stage[main]/Mistral::Wsgi::Apache/Openstacklib::Wsgi::Apache[mistral_wsgi]/File[mistral_wsgi]: Dependency File[/var/www/cgi-bin/mistral] has failures: true",

Fallback to eventlet mistral-api for the time being until we get
a usable mistral-api image.

Change-Id: Ic10c579aa3b6d0d6a01f120669be3b5dcc5efcda
Depends-On: I54627f1c5a8867738a55bee42075bb6087830c61
Related-Bug: #1724607
(cherry picked from commit e158acb14c4ed92be1a5b961ff1e8ff99b1a5ae3)

docker/services/mistral-api.yaml

index 50c8021..1b4b44f 100644 (file)
@@ -36,6 +36,16 @@ parameters:
     default: {}
     description: Parameters specific to the role
     type: json
+  MistralWorkers:
+    default: 1
+    description: The number of workers for the mistral-api.
+    type: number
+  MistralApiPolicies:
+    description: |
+      A hash of policies to configure for Mistral API.
+      e.g. { mistral-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
+    default: {}
+    type: json
 
 resources:
 
@@ -45,6 +55,16 @@ resources:
   MySQLClient:
     type: ../../puppet/services/database/mysql-client.yaml
 
+  MistralBase:
+    type: ../../puppet/services/mistral-base.yaml
+    properties:
+      EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
+      ServiceNetMap: {get_param: ServiceNetMap}
+      DefaultPasswords: {get_param: DefaultPasswords}
+      RoleName: {get_param: RoleName}
+      RoleParameters: {get_param: RoleParameters}
+
   MistralApiBase:
     type: ../../puppet/services/mistral-api.yaml
     properties:
@@ -60,9 +80,23 @@ outputs:
     description: Role data for the Mistral API role.
     value:
       service_name: {get_attr: [MistralApiBase, role_data, service_name]}
+      # FIXME(mandre) restore once mistral-api image has the necessary packages
+      # to run on top of apache
+      # config_settings:
+      #   map_merge:
+      #     - get_attr: [MistralApiBase, role_data, config_settings]
       config_settings:
         map_merge:
-          - get_attr: [MistralApiBase, role_data, config_settings]
+          - get_attr: [MistralBase, role_data, config_settings]
+          - mistral::api::api_workers: {get_param: MistralWorkers}
+            mistral::api::bind_host: {get_param: [ServiceNetMap, MistralApiNetwork]}
+            mistral::policy::policies: {get_param: MistralApiPolicies}
+            tripleo.mistral_api.firewall_rules:
+              '133 mistral':
+                dport:
+                  - 8989
+                  - 13989
+            mistral_wsgi_enabled: false
       logging_source: {get_attr: [MistralApiBase, role_data, logging_source]}
       logging_groups: {get_attr: [MistralApiBase, role_data, logging_groups]}
       step_config: &step_config