From 92624d6730c47f83d7a97959093a916b5e4e69af Mon Sep 17 00:00:00 2001 From: marios Date: Tue, 23 Jan 2018 18:07:56 +0200 Subject: [PATCH] Add fast_forward_upgrade_tasks for ceilometer services Adds ffu_tasks for ceilometer - stop services on step 1. In the docker/ templates services are also disabled. Lots of changes for ceilo-* since Newton: --> openstack-ceilometer-api, -collector and -expirer are removed in Pike and no longer in the templates. The disable files are re-added by the parent review so these services can be retired with ffu_tasks. --> The disabled services are set back in environment for Fast Forward Upgrade Change-Id: I1c8ac2285ab222cfb7cb7ff898d222ae6e846567 --- docker/services/ceilometer-agent-central.yaml | 20 +++++++++++++++++++ docker/services/ceilometer-agent-compute.yaml | 20 +++++++++++++++++++ docker/services/ceilometer-agent-ipmi.yaml | 20 +++++++++++++++++++ .../ceilometer-agent-notification.yaml | 20 +++++++++++++++++++ .../disabled/ceilometer-api-disabled.yaml | 8 ++++++-- .../ceilometer-collector-disabled.yaml | 18 ++++++++++++++++- .../disabled/ceilometer-expirer-disabled.yaml | 11 ++++++++-- 7 files changed, 112 insertions(+), 5 deletions(-) diff --git a/docker/services/ceilometer-agent-central.yaml b/docker/services/ceilometer-agent-central.yaml index a4869964c7..ceb89315cb 100644 --- a/docker/services/ceilometer-agent-central.yaml +++ b/docker/services/ceilometer-agent-central.yaml @@ -163,3 +163,23 @@ outputs: when: - step|int == 2 - remove_ceilometer_central_package|bool + fast_forward_upgrade_tasks: + - name: FFU check if openstack-ceilometer-central is deployed + command: systemctl is-enabled --quiet openstack-ceilometer-central + ignore_errors: True + register: ceilometer_agent_central_enabled_result + when: + - step|int == 0 + - release == 'ocata' + - name: Set fact ceilometer_agent_central_enabled + set_fact: + ceilometer_agent_central_enabled: "{{ ceilometer_agent_central_enabled_result.rc == 0 }}" + when: + - step|int == 0 + - release == 'ocata' + - name: FFU stop and disable openstack-ceilometer-central service + service: name=openstack-ceilometer-central state=stopped enabled=no + when: + - step|int == 1 + - release == 'ocata' + - ceilometer_agent_central_enabled|bool diff --git a/docker/services/ceilometer-agent-compute.yaml b/docker/services/ceilometer-agent-compute.yaml index 0c2f5ffc6d..8e15c7893b 100644 --- a/docker/services/ceilometer-agent-compute.yaml +++ b/docker/services/ceilometer-agent-compute.yaml @@ -158,3 +158,23 @@ outputs: when: - step|int == 2 - remove_ceilometer_compute_polling_package|bool + fast_forward_upgrade_tasks: + - name: FFU check if openstack-ceilometer-compute is deployed + command: systemctl is-enabled openstack-ceilometer-compute + ignore_errors: True + register: ceilometer_agent_compute_enabled_result + when: + - step|int == 0 + - release == 'ocata' + - name: Set fact ceilometer_agent_compute_enabled + set_fact: + ceilometer_agent_compute_enabled: "{{ ceilometer_agent_compute_enabled_result.rc == 0 }}" + when: + - step|int == 0 + - release == 'ocata' + - name: FFU stop and disable openstack-ceilometer-compute service + when: + - step|int == 1 + - release == 'ocata' + - ceilometer_agent_compute_enabled|bool + service: name=openstack-ceilometer-compute state=stopped enabled=no diff --git a/docker/services/ceilometer-agent-ipmi.yaml b/docker/services/ceilometer-agent-ipmi.yaml index 741a61ef63..50b14c963c 100644 --- a/docker/services/ceilometer-agent-ipmi.yaml +++ b/docker/services/ceilometer-agent-ipmi.yaml @@ -144,3 +144,23 @@ outputs: when: - step|int == 2 - remove_ceilometer_ipmi_package|bool + fast_forward_upgrade_tasks: + - name: FFU check if openstack-ceilometer-ipmi is enabled + command: systemctl is-enabled openstack-ceilometer-ipmi + ignore_errors: True + register: ceilometer_ipmi_enabled_result + when: + - step|int == 0 + - release == 'ocata' + - name: Set fact ceilometer_ipmi_enabled + set_fact: + ceilometer_ipmi_enabled: "{{ ceilometer_ipmi_enabled_result.rc == 0 }}" + when: + - step|int == 0 + - release == 'ocata' + - name: FFU stop and disable openstack-ceilometer-ipmi service + when: + - step|int == 1 + - release == 'ocata' + - ceilometer_ipmi_enabled|bool + service: name=openstack-ceilometer-ipmi state=stopped enabled=no diff --git a/docker/services/ceilometer-agent-notification.yaml b/docker/services/ceilometer-agent-notification.yaml index 5891c64a87..25fde8262b 100644 --- a/docker/services/ceilometer-agent-notification.yaml +++ b/docker/services/ceilometer-agent-notification.yaml @@ -154,3 +154,23 @@ outputs: when: - step|int == 2 - remove_ceilometer_notification_package|bool + fast_forward_upgrade_tasks: + - name: FFU check if openstack-ceilometer-notification is deployed + command: systemctl is-enabled openstack-ceilometer-notification + ignore_errors: True + register: ceilometer_agent_notification_enabled_result + when: + - step|int == 0 + - release == 'ocata' + - name: Set fact ceilometer_agent_notification_enabled + set_fact: + ceilometer_agent_notification_enabled: "{{ ceilometer_agent_notification_enabled_result.rc == 0 }}" + when: + - step|int == 0 + - release == 'ocata' + - name: FFU stop and diable openstack-ceilometer-notification service + when: + - step|int == 1 + - release == 'ocata' + - ceilometer_agent_notification_enabled|bool + service: name=openstack-ceilometer-notification state=stopped enabled=no diff --git a/puppet/services/disabled/ceilometer-api-disabled.yaml b/puppet/services/disabled/ceilometer-api-disabled.yaml index 35d6de864e..585036eacd 100644 --- a/puppet/services/disabled/ceilometer-api-disabled.yaml +++ b/puppet/services/disabled/ceilometer-api-disabled.yaml @@ -39,7 +39,11 @@ outputs: fast_forward_upgrade_tasks: - name: Purge Ceilometer apache config files file: path=/etc/httpd/conf.d/10-ceilometer_wsgi.conf state=absent - when: step|int == 1 + when: + - step|int == 1 + - release == 'ocata' - name: Clean up ceilometer port from ports.conf lineinfile: dest=/etc/httpd/conf/ports.conf state=absent regexp="8777$" - when: step|int == 1 + when: + - step|int == 1 + - release == 'ocata' diff --git a/puppet/services/disabled/ceilometer-collector-disabled.yaml b/puppet/services/disabled/ceilometer-collector-disabled.yaml index 0c72eeb92d..c489271c59 100644 --- a/puppet/services/disabled/ceilometer-collector-disabled.yaml +++ b/puppet/services/disabled/ceilometer-collector-disabled.yaml @@ -37,6 +37,22 @@ outputs: value: service_name: ceilometer_collector_disabled fast_forward_upgrade_tasks: + - name: FFU check if openstack-ceilometer-collector is deployed + command: systemctl is-enabled --quiet openstack-ceilometer-collector + ignore_errors: True + register: ceilometer_agent_collector_enabled_result + when: + - step|int == 0 + - release == 'ocata' + - name: Set fact ceilometer_agent_collector_enabled + set_fact: + ceilometer_agent_collector_enabled: "{{ ceilometer_agent_collector_enabled_result.rc == 0 }}" + when: + - step|int == 0 + - release == 'ocata' - name: Stop and disable ceilometer_collector service on upgrade service: name=openstack-ceilometer-collector state=stopped enabled=no - when: step|int == 2 + when: + - step|int == 1 + - release == 'ocata' + - ceilometer_agent_collector_enabled|bool diff --git a/puppet/services/disabled/ceilometer-expirer-disabled.yaml b/puppet/services/disabled/ceilometer-expirer-disabled.yaml index 5563aac259..ae973de037 100644 --- a/puppet/services/disabled/ceilometer-expirer-disabled.yaml +++ b/puppet/services/disabled/ceilometer-expirer-disabled.yaml @@ -40,5 +40,12 @@ outputs: - name: Remove ceilometer expirer cron tab on upgrade shell: '/usr/bin/crontab -u ceilometer -r' register: remove_ceilometer_expirer_crontab - failed_when: (remove_ceilometer_expirer_crontab.rc != 0) and (remove_ceilometer_expirer_crontab.stderr != "no crontab for ceilometer") and (step|int == 1) - changed_when: (remove_ceilometer_expirer_crontab.stderr != "no crontab for ceilometer") and (step|int == 1) + failed_when: + - step|int == 1 + - release == 'ocata' + - remove_ceilometer_expirer_crontab.rc != 0 + - remove_ceilometer_expirer_crontab.stderr != "no crontab for ceilometer" + changed_when: + - step|int == 1 + - release == 'ocata' + - remove_ceilometer_expirer_crontab.stderr != "no crontab for ceilometer"