diff --git a/doc/source/upgrade-guide/manual-upgrade.rst b/doc/source/upgrade-guide/manual-upgrade.rst index 82b1b6a2bd..4c4b563545 100644 --- a/doc/source/upgrade-guide/manual-upgrade.rst +++ b/doc/source/upgrade-guide/manual-upgrade.rst @@ -206,6 +206,15 @@ See :ref:`memcached-flush` for details. # openstack-ansible "${UPGRADE_PLAYBOOKS}/memcached-flush.yml" +Stop and remove ``aodh-api`` service +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +See :ref:`aodh-api-init-delete` for details. + +.. code-block:: console + + # openstack-ansible "${UPGRADE_PLAYBOOKS}/aodh-api-init-delete.yml" + Upgrade OpenStack ~~~~~~~~~~~~~~~~~ diff --git a/doc/source/upgrade-guide/reference-upgrade-playbooks.rst b/doc/source/upgrade-guide/reference-upgrade-playbooks.rst index 6871161a1c..0e688e0170 100644 --- a/doc/source/upgrade-guide/reference-upgrade-playbooks.rst +++ b/doc/source/upgrade-guide/reference-upgrade-playbooks.rst @@ -112,6 +112,17 @@ current version of MariaDB and Galera and upgrade to the 10.x series. Sends "flush_all" to memcached with the help of nc. +.. _aodh-api-init-delete: + +``aodh-api-init-delete.yml`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Stops the ``aodh-api`` service and removes the init file since ``aodh-api`` +now runs under Apache ``mod_wsgi``. +Run the ``os-aodh-install.yml`` playbook during the OpenStack services upgrade +to ensure ``aodh-api`` is available after running ``aodh-api-init-delete.yml``. + + -------------- .. include:: navigation.txt diff --git a/scripts/run-upgrade.sh b/scripts/run-upgrade.sh index e7d978df13..4fde0ab066 100755 --- a/scripts/run-upgrade.sh +++ b/scripts/run-upgrade.sh @@ -170,6 +170,7 @@ function main { RUN_TASKS+=("utility-install.yml") RUN_TASKS+=("rsyslog-install.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/memcached-flush.yml") + RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/aodh-api-init-delete.yml") RUN_TASKS+=("setup-openstack.yml") # Run the tasks in order for item in ${!RUN_TASKS[@]}; do diff --git a/scripts/upgrade-utilities/playbooks/aodh-api-init-delete.yml b/scripts/upgrade-utilities/playbooks/aodh-api-init-delete.yml new file mode 100644 index 0000000000..8d71c115b1 --- /dev/null +++ b/scripts/upgrade-utilities/playbooks/aodh-api-init-delete.yml @@ -0,0 +1,47 @@ +--- +# Copyright 2016, Logan Vig +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Delete aodh-api init file + hosts: aodh_all + gather_facts: false + user: root + pre_tasks: + - name: Check init system + command: cat /proc/1/comm + register: _pid1_name + - name: Set the name of pid1 + set_fact: + pid1_name: "{{ _pid1_name.stdout }}" + tasks: + - name: Stop the aodh-api service + service: + name: aodh-api + state: stopped + enabled: no + - name: Remove the aodh-api upstart init file + file: + path: '/etc/init/aodh-api.conf' + state: absent + when: pid1_name == "init" + - name: Reload upstart init scripts + command: initctl reload-configuration + when: pid1_name == "init" + - name: Remove the aodh-api systemd init file + file: + path: '/etc/systemd/system/aodh-api.service' + when: pid1_name == "systemd" + - name: Reload systemd + command: systemctl daemon-reload + when: pid1_name == "systemd"