Adds upgrade tasks for OpenDaylight services
authorTim Rozet <trozet@redhat.com>
Mon, 27 Feb 2017 20:19:56 +0000 (15:19 -0500)
committerTim Rozet <trozet@redhat.com>
Wed, 1 Mar 2017 20:23:41 +0000 (15:23 -0500)
Change-Id: I740b20b12acb3740886409bff86c4989f0a066f4
Signed-off-by: Tim Rozet <trozet@redhat.com>
puppet/services/opendaylight-api.yaml
puppet/services/opendaylight-ovs.yaml

index 1e7aa47..ceb56a8 100644 (file)
@@ -68,3 +68,26 @@ outputs:
                   - 6653
       step_config: |
         include tripleo::profile::base::neutron::opendaylight
+      upgrade_tasks:
+        - name: Check if opendaylight is deployed
+          command: systemctl is-enabled opendaylight
+          tags: common
+          ignore_errors: True
+          register: opendaylight_enabled
+        - name: "PreUpgrade step0,validation: Check service opendaylight is running"
+          shell: /usr/bin/systemctl show 'opendaylight' --property ActiveState | grep '\bactive\b'
+          when: opendaylight_enabled.rc == 0
+          tags: step0,validation
+        - name: Stop opendaylight service
+          tags: step1
+          when: opendaylight_enabled.rc == 0
+          service: name=opendaylight state=stopped
+        - name: Removes ODL snapshots, data, journal directories
+          file:
+            state: absent
+            path: /opt/opendaylight/{{item}}
+          tags: step2
+          with_items:
+            - snapshots
+            - data
+            - journal
index cfec3c4..3db0848 100644 (file)
@@ -73,3 +73,17 @@ outputs:
              proto: 'gre'
       step_config: |
         include tripleo::profile::base::neutron::plugins::ovs::opendaylight
+      upgrade_tasks:
+        - name: Check if openvswitch is deployed
+          command: systemctl is-enabled openvswitch
+          tags: common
+          ignore_errors: True
+          register: openvswitch_enabled
+        - name: "PreUpgrade step0,validation: Check service openvswitch is running"
+          shell: /usr/bin/systemctl show 'openvswitch' --property ActiveState | grep '\bactive\b'
+          when: openvswitch_enabled.rc == 0
+          tags: step0,validation
+        - name: Stop openvswitch service
+          tags: step1
+          when: openvswitch_enabled.rc == 0
+          service: name=openvswitch state=stopped