Add validation task in docker services
[apex-tripleo-heat-templates.git] / docker / services / neutron-dhcp.yaml
index 93401b9..238a2da 100644 (file)
@@ -113,6 +113,16 @@ outputs:
             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