Merge "Fix Upgrade of horizon service"

This commit is contained in:
Zuul 2018-11-15 04:49:19 +00:00 committed by Gerrit Code Review
commit 916c1e5c4e
1 changed files with 11 additions and 1 deletions

View File

@ -196,15 +196,25 @@ outputs:
register: horizon_httpd_enabled_result
- set_fact:
horizon_httpd_enabled: "{{ horizon_httpd_enabled_result.rc == 0 }}"
- name: Check if httpd is running
command: systemctl is-active --quiet httpd
ignore_errors: True
register: httpd_running_result
when: httpd_running is undefined
- name: Set fact httpd_running
set_fact:
httpd_running: "{{ httpd_running_result.rc == 0 }}"
when: httpd_running is undefined
- name: "PreUpgrade step0,validation: Check if horizon is running"
shell: systemctl is-active --quiet httpd
when:
- horizon_httpd_enabled|bool
- httpd_running|bool
tags: validation
- name: Stop and disable horizon service (running under httpd)
when:
- step|int == 2
- horizon_httpd_enabled|bool
- httpd_running|bool
service: name=httpd state=stopped enabled=no
metadata_settings:
get_attr: [HorizonBase, role_data, metadata_settings]