30899b8368
In cases where no old process was found, the shell command was exiting 1 and causing the handler to report a failure. Change-Id: Ic1701f7495abdec713c05d2c95bfdd1e7b1ff73d Closes-Bug: #1603136
42 lines
1.6 KiB
YAML
42 lines
1.6 KiB
YAML
---
|
|
# Copyright 2014, Rackspace US, Inc.
|
|
#
|
|
# 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: Restart neutron services
|
|
service:
|
|
name: "{{ item.value.service_name }}"
|
|
state: restarted
|
|
pattern: "{{ item.value.service_name }}"
|
|
with_dict: "{{ neutron_services }}"
|
|
failed_when: false
|
|
notify:
|
|
- Run ns-metadata-proxy process cleanup
|
|
when: item.value.service_en | bool
|
|
|
|
# NOTE(cloudnull):
|
|
# When installing or upgrading it is possible that an old metadata proxy process will not
|
|
# be restarted by the metadata agent when a version changes. To fix it the ns-metadata
|
|
# proxy pids are killed if they're not running the current tag. Once the old processeses
|
|
# are removed the metadata agent will respawn the missing process within 60 seconds using
|
|
# the correct code.
|
|
- name: Run ns-metadata-proxy process cleanup
|
|
shell: |
|
|
for ns_pid in $(pgrep neutron-ns-meta); do
|
|
echo $(readlink -f "/proc/$ns_pid/exe") | grep -qv "{{ neutron_venv_tag }}"
|
|
if [ $? -eq 0 ]; then
|
|
(echo "old metadata proxy pid found running clean up on $ns_pid"; kill -9 "$ns_pid")
|
|
fi
|
|
done
|
|
when: neutron_services['neutron-metadata-agent'].service_en | bool
|