Merge "Remove empty metadata_settings from iscsid and multipathd templates"
[apex-tripleo-heat-templates.git] / docker / services / neutron-api.yaml
index a2e5e17..b4fce22 100644 (file)
@@ -4,23 +4,21 @@ description: >
   OpenStack containerized Neutron API service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerNeutronApiImage:
     description: image
-    default: 'centos-binary-neutron-server:latest'
     type: string
   DockerNeutronConfigImage:
     description: The container image to use for the neutron config_volume
-    default: 'centos-binary-neutron-server:latest'
     type: string
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
                  via parameter_defaults in the resource registry.
     type: json
+  ServiceData:
+    default: {}
+    description: Dictionary packing service data
+    type: json
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -51,10 +49,14 @@ resources:
   ContainersCommon:
     type: ./containers-common.yaml
 
+  MySQLClient:
+    type: ../../puppet/services/database/mysql-client.yaml
+
   NeutronBase:
     type: ../../puppet/services/neutron-api.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       RoleName: {get_param: RoleName}
@@ -69,17 +71,17 @@ outputs:
         map_merge:
           - get_attr: [NeutronBase, role_data, config_settings]
       step_config: &step_config
-        get_attr: [NeutronBase, role_data, step_config]
+        list_join:
+          - "\n"
+          - - {get_attr: [NeutronBase, role_data, step_config]}
+            - {get_attr: [MySQLClient, role_data, step_config]}
       service_config_settings: {get_attr: [NeutronBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
         config_volume: neutron
         puppet_tags: neutron_config,neutron_api_config
         step_config: *step_config
-        config_image:
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
+        config_image: {get_param: DockerNeutronConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/neutron_api.json:
           command: /usr/bin/neutron-server --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-server
@@ -103,10 +105,7 @@ outputs:
         # db sync runs before permissions set by kolla_config
         step_2:
           neutron_init_logs:
-            image: &neutron_api_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerNeutronApiImage} ]
+            image: &neutron_api_image {get_param: DockerNeutronApiImage}
             privileged: false
             user: root
             volumes:
@@ -170,8 +169,18 @@ outputs:
             path: /var/log/containers/neutron
             state: directory
       upgrade_tasks:
+        - name: Check if neutron_server is deployed
+          command: systemctl is-enabled neutron-server
+          tags: common
+          ignore_errors: True
+          register: neutron_server_enabled
+        - name: "PreUpgrade step0,validation: Check service neutron-server is running"
+          shell: /usr/bin/systemctl show 'neutron-server' --property ActiveState | grep '\bactive\b'
+          when: neutron_server_enabled.rc == 0
+          tags: step0,validation
         - name: Stop and disable neutron_api service
           tags: step2
+          when: neutron_server_enabled.rc == 0
           service: name=neutron-server state=stopped enabled=no
       metadata_settings:
         get_attr: [NeutronBase, role_data, metadata_settings]