Add validation task in docker services [Mixed-2]

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: Iee10761330311d40825f0ad11b676d8f1f20355f
Partial-Bug: #1704389
This commit is contained in:
Jose Luis Franco Arza 2017-09-19 16:30:41 +02:00
parent 5840413021
commit 726303d9d3
7 changed files with 75 additions and 0 deletions

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

@ -113,8 +113,18 @@ outputs:
path: /var/log/containers/collectd
state: directory
upgrade_tasks:
- name: Check if collectd is deployed
command: systemctl is-enabled --quiet collectd
tags: common
ignore_errors: True
register: collectd_enabled
- name: "PreUpgrade step0,validation: Check service collectd service is running"
command: systemctl is-active --quiet collectd
when: collectd_enabled.rc == 0
tags: step0,validation
- name: Stop and disable collectd service
tags: step2
when: collectd_enabled.rc == 0
service: name=collectd.service state=stopped enabled=no
- name: Remove collectd package if operator requests it
yum: name=collectd state=removed

@ -198,8 +198,23 @@ outputs:
config_image: *keystone_config_image
host_prep_tasks: {get_attr: [KeystoneLogging, host_prep_tasks]}
upgrade_tasks:
- name: Check for keystone running under apache
tags: common
shell: "httpd -t -D DUMP_VHOSTS | grep -q keystone_wsgi"
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 keystone_wsgi is running under httpd"
shell: systemctl status 'httpd' | grep -q keystone
tags: step0,validation
when: httpd_enabled.rc == 0 and httpd_running.rc == 0
- name: Stop and disable keystone 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 old keystone cron jobs
tags: step2

@ -109,6 +109,16 @@ outputs:
path: /var/log/containers/memcached
state: directory
upgrade_tasks:
- name: Check if memcached is deployed
command: systemctl is-enabled --quiet memcached
tags: common
ignore_errors: True
register: memcached_enabled
- name: "PreUpgrade step0,validation: Check service memcached is running"
command: systemctl is-active --quiet memcached
when: memcached_enabled.rc == 0
tags: step0,validation
- name: Stop and disable memcached service
tags: step2
when: memcached_enabled.rc == 0
service: name=memcached state=stopped enabled=no

@ -87,6 +87,16 @@ outputs:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks:
upgrade_tasks:
- name: Check if multipathd is deployed
command: systemctl is-enabled --quiet multipathd
tags: common
ignore_errors: True
register: multipathd_enabled
- name: "PreUpgrade step0,validation: Check service multipathd is running"
command: systemctl is-active --quiet multipathd
when: multipathd_enabled.rc == 0
tags: step0,validation
- name: Stop and disable multipathd service
tags: step2
when: multipathd_enabled.rc == 0
service: name=multipathd state=stopped enabled=no

@ -116,6 +116,16 @@ outputs:
- /var/lib/opendaylight/snapshots
- /var/lib/opendaylight/journal
upgrade_tasks:
- name: Check if opendaylight is deployed
command: systemctl is-enabled --quiet opendaylight
tags: common
ignore_errors: True
register: opendaylight_enabled
- name: "PreUpgrade step0,validation: Check service opendaylight is running"
command: systemctl is-active --quiet opendaylight
when: opendaylight_enabled.rc == 0
tags: step0,validation
- name: Stop and disable opendaylight_api service
tags: step2
when: opendaylight_enabled.rc == 0
service: name=opendaylight state=stopped enabled=no

@ -219,8 +219,18 @@ outputs:
- /var/log/containers/rabbitmq
- /var/lib/rabbitmq
upgrade_tasks:
- name: Check if rabbitmq server is deployed
command: systemctl is-enabled --quiet rabbitmq-server
tags: common
ignore_errors: True
register: rabbitmq_enabled
- name: "PreUpgrade step0,validation: Check service rabbitmq server is running"
command: systemctl is-active --quiet rabbitmq-server
when: rabbitmq_enabled.rc == 0
tags: step0,validation
- name: Stop and disable rabbitmq service
tags: step2
when: rabbitmq_enabled.rc == 0
service: name=rabbitmq-server state=stopped enabled=no
update_tasks:
# TODO: Are we sure we want to support this. Rolling update