Red Hat Bugzilla – Bug 1474508
Embedded ansible services do not stop when role is removed
Last modified: 2017-10-13 09:07:44 EDT
Description of problem:
When the Embedded Ansible role is removed from a server the services do not get stopped.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start the Embedded Ansible role
2. Wait for the role to complete setup
3. Remove the Embedded Ansible role from the server
EmbeddedAnsible.running? and EmbeddedAnsible.alive? return true
(also supervisord, nginx, and rabbitmq-server are all running)
The methods should return false and the services should not be running when the role is active.
This seems to be caused by the changes in https://github.com/ManageIQ/manageiq/pull/15612 which created an alias for stop to kill.
This doesn't allow the worker to stop the services and could lead to having multiple instances of the services running on separate servers.
New commit detected on ManageIQ/manageiq/master:
Author: Joe Rafaniello <firstname.lastname@example.org>
AuthorDate: Mon Jul 24 14:34:11 2017 -0400
Commit: Joe Rafaniello <email@example.com>
CommitDate: Mon Jul 24 16:36:00 2017 -0400
Let ansible worker gracefully stop
When the ansible worker is not responding, let it try to gracefuly exit
by marking it as stopping. Allow, the stopping worker code to eventually
kill the worker if it doesn't exit on it's own.
While we're allowing the worker to gracefully exit, don't allow multiple
ansible monitor workers to run at once. Normally, a replacement worker
is started the moment we ask a prior worker to exit.
app/models/embedded_ansible_worker.rb | 6 ++---
spec/models/embedded_ansible_worker_spec.rb | 40 ++++++++++++++---------------
2 files changed, 22 insertions(+), 24 deletions(-)
Verified in 188.8.131.52.20171010190026_0413a06. After disabling embedded ansible role EmbeddedAnsible.running? and EmbeddedAnsible.alive? return false, supervisord, nginx, and rabbitmq-server services are not running.