From e64e466d1725863bd8747b3be76f91f68ef41ce1 Mon Sep 17 00:00:00 2001 From: David J Peacock Date: Thu, 29 Mar 2018 11:39:27 -0400 Subject: [PATCH] init --- tasks/fast_forward_upgrade.yaml | 46 +++++++++++++++++++++++++++++++++ tasks/main.yaml | 0 tasks/upgrade.yaml | 28 ++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 tasks/fast_forward_upgrade.yaml create mode 100644 tasks/main.yaml create mode 100644 tasks/upgrade.yaml diff --git a/tasks/fast_forward_upgrade.yaml b/tasks/fast_forward_upgrade.yaml new file mode 100644 index 0000000..7d6607d --- /dev/null +++ b/tasks/fast_forward_upgrade.yaml @@ -0,0 +1,46 @@ +- name: Check for keystone running under apache + tags: common + shell: httpd -t -D DUMP_VHOSTS | grep -q keystone_wsgi + ignore_errors: true + register: keystone_httpd_enabled_result + when: + - step|int == 0 + - release == 'ocata' +- name: Set fact keystone_httpd_enabled + set_fact: + keystone_httpd_enabled: '{{ keystone_httpd_enabled_result.rc == 0 }}' + when: + - step|int == 0 + - release == 'ocata' +- name: Check if httpd is running + ignore_errors: true + command: systemctl is-active --quiet httpd + register: httpd_running_result + when: + - step|int == 0 + - release == 'ocata' + - httpd_running is undefined +- name: Set fact httpd_running if undefined + set_fact: + httpd_running: '{{ httpd_running_result.rc == 0 }}' + when: + - step|int == 0 + - release == 'ocata' + - httpd_running is undefined +- name: Stop and disable keystone (under httpd) + service: name=httpd state=stopped enabled=no + when: + - step|int == 1 + - release == 'ocata' + - keystone_httpd_enabled|bool + - httpd_running|bool +- name: Keystone package update + yum: name=openstack-keystone* state=latest + when: + - step|int == 6 + - is_bootstrap_node|bool +- name: keystone db sync + command: keystone-manage db_sync + when: + - step|int == 8 + - is_bootstrap_node|bool diff --git a/tasks/main.yaml b/tasks/main.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tasks/upgrade.yaml b/tasks/upgrade.yaml new file mode 100644 index 0000000..16b1463 --- /dev/null +++ b/tasks/upgrade.yaml @@ -0,0 +1,28 @@ +- 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: validation + when: + - step|int == 0 + - httpd_enabled.rc == 0 + - httpd_running.rc == 0 +- name: Stop and disable keystone service (running under httpd) + when: + - step|int == 2 + - httpd_enabled.rc == 0 + - httpd_running.rc == 0 + service: name=httpd state=stopped enabled=no +- name: remove old keystone cron jobs + when: step|int == 2 + file: + path: /var/spool/cron/keystone + state: absent