Merge "Cleanup no longer used upgrade files"
[apex-tripleo-heat-templates.git] / puppet / services / haproxy.yaml
index 7c7df34..bd5b9ef 100644 (file)
@@ -78,14 +78,22 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::haproxy
       upgrade_tasks:
+        - name: Check if haproxy is deployed
+          command: systemctl is-enabled haproxy
+          tags: common
+          ignore_errors: True
+          register: haproxy_enabled
         - name: "PreUpgrade step0,validation: Check service haproxy is running"
           shell: /usr/bin/systemctl show 'haproxy' --property ActiveState | grep '\bactive\b'
+          when: haproxy_enabled.rc == 0
           tags: step0,validation
         - name: Stop haproxy service
           tags: step2
+          when: haproxy_enabled.rc == 0
           service: name=haproxy state=stopped
         - name: Start haproxy service
           tags: step4 # Needed at step 4 for mysql
+          when: haproxy_enabled.rc == 0
           service: name=haproxy state=started
       metadata_settings:
         yaql: