2015-09-28 10:07:31 -07:00
|
|
|
---
|
|
|
|
- hosts: 'jenkins0*.openstack.org'
|
2015-10-17 13:34:23 -04:00
|
|
|
# Do the entire play completely for one host at a time
|
|
|
|
serial: 1
|
2015-09-28 10:07:31 -07:00
|
|
|
# Treat any errors as fatal so that we don't stop all the jenkins
|
|
|
|
# masters.
|
|
|
|
any_errors_fatal: true
|
|
|
|
tasks:
|
|
|
|
- shell: '/usr/local/jenkins/bin/safe_jenkins_shutdown --url https://{{ ansible_fqdn }}/ --user {{ user }} --password {{ password }}'
|
|
|
|
- service: name=jenkins state=stopped
|
|
|
|
# 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" ]'
|
2015-10-14 12:15:37 -07:00
|
|
|
- service: name=jenkins state=restarted
|