Add validation task in docker services [Heat]
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: I04c6e8c9c1cd0b427465fbab7df99823e7bcd02c Partial-Bug: #1704389
This commit is contained in:
parent
9bd858ebdf
commit
43f241f698
@ -132,24 +132,35 @@ outputs:
|
|||||||
- /var/log/containers/httpd/heat-api-cfn
|
- /var/log/containers/httpd/heat-api-cfn
|
||||||
upgrade_tasks:
|
upgrade_tasks:
|
||||||
- name: Check if heat_api_cfn is deployed
|
- name: Check if heat_api_cfn is deployed
|
||||||
command: systemctl is-enabled openstack-heat-api-cfn
|
command: systemctl is-enabled --quiet openstack-heat-api-cfn
|
||||||
tags: common
|
tags: common
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
register: heat_api_cfn_enabled
|
register: heat_api_cfn_enabled
|
||||||
- name: check for heat_api_cfn running under apache (post upgrade)
|
- name: Check for heat_api_cfn running under apache
|
||||||
tags: step2
|
tags: common
|
||||||
shell: "httpd -t -D DUMP_VHOSTS | grep -q heat_api_cfn_wsgi"
|
shell: "httpd -t -D DUMP_VHOSTS | grep -q heat_api_cfn_wsgi"
|
||||||
register: heat_api_cfn_apache
|
ignore_errors: True
|
||||||
ignore_errors: true
|
register: httpd_enabled
|
||||||
changed_when: false
|
- name: "PreUpgrade step0,validation: Check service openstack-heat-api-cfn is running"
|
||||||
check_mode: no
|
command: systemctl is-active --quiet openstack-heat-api-cfn
|
||||||
- name: Stop heat_api_cfn service (running under httpd)
|
when: heat_api_cfn_enabled.rc == 0 and httpd_enabled.rc != 0
|
||||||
tags: step2
|
tags: step0,validation
|
||||||
service: name=httpd state=stopped
|
|
||||||
when: heat_api_cfn_apache.rc == 0
|
|
||||||
- name: Stop and disable heat_api_cfn service (pre-upgrade not under httpd)
|
- name: Stop and disable heat_api_cfn service (pre-upgrade not under httpd)
|
||||||
tags: step2
|
tags: step2
|
||||||
service: name=openstack-heat-api-cfn state=stopped enabled=no
|
service: name=openstack-heat-api-cfn state=stopped enabled=no
|
||||||
when: heat_api_cfn_enabled.rc == 0
|
when: heat_api_cfn_enabled.rc == 0 and httpd_enabled.rc != 0
|
||||||
|
- name: Check if httpd service is running
|
||||||
|
command: systemctl is-active --quiet httpd
|
||||||
|
tags: common
|
||||||
|
ignore_errors: True
|
||||||
|
register: httpd_running
|
||||||
|
- name: "PreUpgrade step0,validation: Check if heat_api_cfn_wsgi is running"
|
||||||
|
tags: step0,validation
|
||||||
|
shell: systemctl status 'httpd' | grep -q heat_api_cfn_wsgi
|
||||||
|
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
|
||||||
|
- name: Stop heat_api_cfn service (running under httpd)
|
||||||
|
tags: step2
|
||||||
|
service: name=httpd state=stopped
|
||||||
|
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
|
||||||
metadata_settings:
|
metadata_settings:
|
||||||
get_attr: [HeatBase, role_data, metadata_settings]
|
get_attr: [HeatBase, role_data, metadata_settings]
|
||||||
|
@ -160,30 +160,41 @@ outputs:
|
|||||||
- /var/log/containers/heat
|
- /var/log/containers/heat
|
||||||
- /var/log/containers/httpd/heat-api
|
- /var/log/containers/httpd/heat-api
|
||||||
upgrade_tasks:
|
upgrade_tasks:
|
||||||
- name: Check is heat_api is deployed
|
- name: Check if heat_api is deployed
|
||||||
command: systemctl is-enabled openstack-heat-api
|
command: systemctl is-enabled --quiet openstack-heat-api
|
||||||
tags: common
|
tags: common
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
register: heat_api_enabled
|
register: heat_api_enabled
|
||||||
|
- name: Check for heat_api running under apache
|
||||||
|
tags: common
|
||||||
|
shell: "httpd -t -D DUMP_VHOSTS | grep -q heat_api_wsgi"
|
||||||
|
ignore_errors: True
|
||||||
|
register: httpd_enabled
|
||||||
|
- name: "PreUpgrade step0,validation: Check service openstack-heat-api is running"
|
||||||
|
command: systemctl is-active --quiet openstack-heat-api
|
||||||
|
when: heat_api_enabled.rc == 0 and httpd_enabled.rc != 0
|
||||||
|
tags: step0,validation
|
||||||
|
- name: Stop and disable heat_api service (pre-upgrade not under httpd)
|
||||||
|
tags: step2
|
||||||
|
service: name=openstack-heat-api state=stopped enabled=no
|
||||||
|
when: heat_api_enabled.rc == 0 and httpd_enabled.rc != 0
|
||||||
|
- 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 heat_api_wsgi is running"
|
||||||
|
shell: systemctl status 'httpd' | grep -q heat_api_wsgi
|
||||||
|
tags: step0,validation
|
||||||
|
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
|
||||||
|
- name: Stop heat_api service (running under httpd)
|
||||||
|
tags: step2
|
||||||
|
service: name=httpd state=stopped
|
||||||
|
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
|
||||||
- name: remove old heat cron jobs
|
- name: remove old heat cron jobs
|
||||||
tags: step2
|
tags: step2
|
||||||
file:
|
file:
|
||||||
path: /var/spool/cron/heat
|
path: /var/spool/cron/heat
|
||||||
state: absent
|
state: absent
|
||||||
- name: check for heat_api running under apache (post upgrade)
|
|
||||||
tags: step2
|
|
||||||
shell: "httpd -t -D DUMP_VHOSTS | grep -q heat_api_wsgi"
|
|
||||||
register: heat_api_apache
|
|
||||||
ignore_errors: true
|
|
||||||
changed_when: false
|
|
||||||
check_mode: no
|
|
||||||
- name: Stop heat_api service (running under httpd)
|
|
||||||
tags: step2
|
|
||||||
service: name=httpd state=stopped
|
|
||||||
when: heat_api_apache.rc == 0
|
|
||||||
- name: Stop and disable heat_api service (pre-upgrade not under httpd)
|
|
||||||
tags: step2
|
|
||||||
service: name=openstack-heat-api state=stopped enabled=no
|
|
||||||
when: heat_api_enabled.rc == 0
|
|
||||||
metadata_settings:
|
metadata_settings:
|
||||||
get_attr: [HeatBase, role_data, metadata_settings]
|
get_attr: [HeatBase, role_data, metadata_settings]
|
||||||
|
@ -135,6 +135,16 @@ outputs:
|
|||||||
path: /var/log/containers/heat
|
path: /var/log/containers/heat
|
||||||
state: directory
|
state: directory
|
||||||
upgrade_tasks:
|
upgrade_tasks:
|
||||||
|
- name: Check if heat_engine is deployed
|
||||||
|
command: systemctl is-enabled --quiet openstack-heat-engine
|
||||||
|
tags: common
|
||||||
|
ignore_errors: True
|
||||||
|
register: heat_engine_enabled
|
||||||
|
- name: "PreUpgrade step0,validation: Check service openstack-heat-engine is running"
|
||||||
|
command: systemctl is-active --quiet openstack-heat-engine
|
||||||
|
when: heat_engine_enabled.rc == 0
|
||||||
|
tags: step0,validation
|
||||||
- name: Stop and disable heat_engine service
|
- name: Stop and disable heat_engine service
|
||||||
tags: step2
|
tags: step2
|
||||||
|
when: heat_engine_enabled.rc == 0
|
||||||
service: name=openstack-heat-engine state=stopped enabled=no
|
service: name=openstack-heat-engine state=stopped enabled=no
|
||||||
|
Loading…
Reference in New Issue
Block a user