upgrades/validation: only run validation when services exist
[apex-tripleo-heat-templates.git] / puppet / services / neutron-dhcp.yaml
index b31933f..fe7f9f3 100644 (file)
@@ -80,9 +80,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::neutron::dhcp
       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 neutron_dhcp service
           tags: step1
+          when: neutron_dhcp_agent_enabled.rc == 0
           service: name=neutron-dhcp-agent state=stopped