Add validation task in docker services [Aodh]

Docker services are missing the pre-upgrade validation task
in the upgrade_tasks section which verifies if the service
is running before going on with the upgrade.

Change-Id: I0df382206bd27343455a6ad18fa2df1eea74a1f5
Partial-Bug: #1704389
This commit is contained in:
Jose Luis Franco Arza 2017-08-07 11:21:31 +02:00 committed by mathieu bultel
parent 49341d6a9a
commit d492677559
4 changed files with 46 additions and 1 deletions

View File

@ -167,8 +167,23 @@ outputs:
/var/log/containers/aodh and /var/log/containers/httpd/aodh-api.
ignore_errors: true
upgrade_tasks:
- name: Check for aodh api service running under apache
tags: common
shell: "httpd -t -D DUMP_VHOSTS | grep -q aodh"
ignore_errors: True
register: httpd_enabled
- name: Check if httpd is running
tags: common
command: systemctl is-active --quiet httpd
ignore_errors: True
register: httpd_running
- name: "PreUpgrade step0,validation: Check if aodh api is running"
shell: systemctl status 'httpd' | grep -q aodh
tags: step0,validation
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
- name: Stop and disable aodh service (running under httpd)
tags: step2
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
service: name=httpd state=stopped enabled=no
- name: Remove openstack-aodh-api package if operator requests it
yum: name=openstack-aodh-api state=removed

View File

@ -123,8 +123,18 @@ outputs:
/var/log/containers/aodh and /var/log/containers/httpd/aodh-api.
ignore_errors: true
upgrade_tasks:
- name: Check if aodh_evaluator is deployed
command: systemctl is-enabled --quiet openstack-aodh-evaluator
tags: common
ignore_errors: True
register: aodh_evaluator_enabled
- name: "PreUpgrade step0,validation: Check service openstack-aodh-evaluator is running"
command: systemctl is-active --quiet openstack-aodh-evaluator
when: aodh_evaluator_enabled.rc == 0
tags: step0,validation
- name: Stop and disable openstack-aodh-evaluator service
tags: step2
when: aodh_evaluator_enabled.rc == 0
service: name=openstack-aodh-evaluator.service state=stopped enabled=no
- name: Remove openstack-aodh-evaluator package if operator requests it
yum: name=openstack-aodh-evaluator state=removed

View File

@ -123,8 +123,18 @@ outputs:
/var/log/containers/aodh and /var/log/containers/httpd/aodh-api.
ignore_errors: true
upgrade_tasks:
- name: Check if aodh_listener is deployed
command: systemctl is-enabled --quiet openstack-aodh-listener
tags: common
ignore_errors: True
register: aodh_listener_enabled
- name: "PreUpgrade step0,validation: Check service openstack-aodh-listener is running"
command: systemctl is-active --quiet openstack-aodh-listener
when: aodh_listener_enabled.rc == 0
tags: step0,validation
- name: Stop and disable openstack-aodh-listener service
tags: step2
when: aodh_listener_enabled.rc == 0
service: name=openstack-aodh-listener.service state=stopped enabled=no
- name: Remove openstack-aodh-listener package if operator requests it
yum: name=openstack-aodh-listener state=removed

View File

@ -123,9 +123,19 @@ outputs:
/var/log/containers/aodh and /var/log/containers/httpd/aodh-api.
ignore_errors: true
upgrade_tasks:
- name: Check if aodh_notifier is deployed
command: systemctl is-enabled --quiet openstack-aodh-notifier
tags: common
ignore_errors: True
register: aodh_notifier_enabled
- name: "PreUpgrade step0,validation: Check service openstack-aodh-notifier is running"
command: systemctl is-active --quiet openstack-aodh-notifier
when: aodh_notifier_enabled.rc == 0
tags: step0,validation
- name: Stop and disable openstack-aodh-notifier service
tags: step2
service: name=openstack-aodh-notifier.service state=stopped enabled=no
when: aodh_notifier_enabled.rc == 0
service: name=openstack-aodh-notifier state=stopped enabled=no
- name: Remove openstack-aodh-notifier package if operator requests it
yum: name=openstack-aodh-notifier state=removed
tags: step2