From: David Galloway Date: Wed, 16 Sep 2020 16:07:33 +0000 (-0400) Subject: ansible: REstart the jenkins agent service when changes are made X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1661%2Fhead;p=ceph-build.git ansible: REstart the jenkins agent service when changes are made Signed-off-by: David Galloway --- diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index 5d432f6a..f4ec8429 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -725,6 +725,7 @@ url: "{{ api_uri }}/jnlpJars/slave.jar" dest: "/home/{{ jenkins_user }}/slave.jar" force: yes + register: jar_changed - name: Install the systemd unit files for jenkins template: @@ -733,6 +734,7 @@ with_items: - service - secret + register: unit_files_changed - name: Reload systemd unit files (to pick up potential changes) systemd: @@ -743,4 +745,11 @@ name: jenkins state: started enabled: yes + + - name: REstart jenkins service (if necessary) + service: + name: jenkins + state: restarted + enabled: yes + when: jar_changed is changed or unit_files_changed is changed when: permanent|bool