Add validation task in docker services [Horizon]

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: Ib30826c41489cb22174cc083a01c3c3b091f3fe3
Partial-Bug: #1704389
This commit is contained in:
Jose Luis Franco Arza 2017-11-28 16:08:26 +01:00
parent fb8cad4b97
commit ce64848abe
1 changed files with 10 additions and 0 deletions

View File

@ -187,8 +187,18 @@ outputs:
/var/log/containers/horizon and /var/log/containers/httpd/horizon.
ignore_errors: true
upgrade_tasks:
- name: Check for horizon running under apache
tags: common
shell: "httpd -t -D DUMP_VHOSTS | grep -q horizon_vhost"
ignore_errors: True
register: httpd_enabled
- name: "PreUpgrade step0,validation: Check if horizon is running"
shell: systemctl is-active --quiet httpd
when: httpd_enabled.rc == 0
tags: step0,validation
- name: Stop and disable horizon service (running under httpd)
tags: step2
when: httpd_enabled.rc == 0
service: name=httpd state=stopped enabled=no
metadata_settings:
get_attr: [HorizonBase, role_data, metadata_settings]