From e8d1948f0a4b3f06792d6112291782ef707719c8 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 14 Oct 2015 12:15:37 -0700 Subject: [PATCH] Use ansible service restart instead of start The ansible service module is smart and will check the status of a daemon and only start it if deemed necessary when asked to start a service. The problem with this is that jenkins can go sideways confusing the daemon system making it think the service is up even though we have kill -9'd it into oblivion. The simple work around for this is to use restart which will always bounce the service in ansible. Change-Id: I240c318e9fa824d88bb817cf382d50ba2902d668 --- .../files/ansible/playbooks/restart_jenkins_masters.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openstack_project/files/ansible/playbooks/restart_jenkins_masters.yaml b/modules/openstack_project/files/ansible/playbooks/restart_jenkins_masters.yaml index 0f96c6b4ec..0946608b8d 100644 --- a/modules/openstack_project/files/ansible/playbooks/restart_jenkins_masters.yaml +++ b/modules/openstack_project/files/ansible/playbooks/restart_jenkins_masters.yaml @@ -9,4 +9,4 @@ # This is necessary because stopping Jenkins is not reliable. # We allow return code 1 which means no processes found. - shell: 'pkill -9 -U jenkins || [ $? -eq "1" ]' - - service: name=jenkins state=started + - service: name=jenkins state=restarted