Merge "Open up firewall for the control-ports in the bundles"
[apex-tripleo-heat-templates.git] / docker / services / neutron-dhcp.yaml
index 93401b9..4b75d54 100644 (file)
@@ -4,23 +4,21 @@ description: >
   OpenStack containerized Neutron DHCP service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerNeutronDHCPImage:
     description: image
-    default: 'centos-binary-neutron-dhcp-agent: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
@@ -48,6 +46,7 @@ resources:
     type: ../../puppet/services/neutron-dhcp.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       RoleName: {get_param: RoleName}
@@ -69,10 +68,7 @@ outputs:
         config_volume: neutron
         puppet_tags: neutron_config,neutron_dhcp_agent_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_dhcp.json:
           command: /usr/bin/neutron-dhcp-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini --log-file /var/log/neutron/dhcp-agent.log --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-dhcp-agent
@@ -85,13 +81,13 @@ outputs:
             - path: /var/log/neutron
               owner: neutron:neutron
               recurse: true
+            - path: /var/lib/neutron
+              owner: neutron:neutron
+              recurse: true
       docker_config:
         step_4:
           neutron_dhcp:
-            image:
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerNeutronDHCPImage} ]
+            image: {get_param: DockerNeutronDHCPImage}
             net: host
             pid: host
             privileged: true
@@ -104,15 +100,30 @@ outputs:
                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
                   - /lib/modules:/lib/modules:ro
                   - /run/:/run
+                  - /var/lib/neutron:/var/lib/neutron
                   - /var/log/containers/neutron:/var/log/neutron
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
       host_prep_tasks:
+        - name: create /var/lib/neutron
+          file:
+            path: /var/lib/neutron
+            state: directory
         - name: create persistent logs directory
           file:
             path: /var/log/containers/neutron
             state: directory
       upgrade_tasks:
+        - name: Check if neutron_dhcp_agent is deployed
+          command: systemctl is-enabled neutron-dhcp-agent
+          tags: common
+          ignore_errors: True
+          register: neutron_dhcp_agent_enabled
+        - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
+          shell: /usr/bin/systemctl show 'neutron-dhcp-agent' --property ActiveState | grep '\bactive\b'
+          when: neutron_dhcp_agent_enabled.rc == 0
+          tags: step0,validation
         - name: Stop and disable neutron_dhcp service
           tags: step2
+          when: neutron_dhcp_agent_enabled.rc == 0
           service: name=neutron-dhcp-agent state=stopped enabled=no