Add support for upgrading ec2-api
authorCarlos Camacho <ccamacho@redhat.com>
Wed, 25 Jan 2017 16:55:59 +0000 (17:55 +0100)
committerCarlos Camacho <ccamacho@redhat.com>
Tue, 28 Feb 2017 10:06:55 +0000 (11:06 +0100)
Change-Id: I2703dd1a7e3eefa0ad6f7b74183101de6c1ad915

puppet/services/ec2-api.yaml

index 7049d77..fd10a66 100644 (file)
@@ -116,3 +116,19 @@ outputs:
           ec2api::db::mysql::allowed_hosts:
             - '%'
             - "%{hiera('mysql_bind_host')}"
+      upgrade_tasks:
+        - name: Check if ec2-api is deployed
+          command: systemctl is-enabled openstack-ec2-api
+          tags: step0,validation
+          ignore_errors: True
+          register: ec2-api_enabled
+        - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
+          shell: >
+            /usr/bin/systemctl show 'openstack-ec2-api' --property ActiveState |
+            grep '\bactive\b'
+          when: ec2-api_enabled.rc == 0
+          tags: step0,validation
+        - name: Stop openstack-ec2-api service
+          tags: step1
+          service: name=openstack-ec2-api state=stopped
+