The DevOps 2.0 Toolkit by Viktor Farcic

The DevOps 2.0 Toolkit by Viktor Farcic

Author:Viktor Farcic
Language: eng
Format: epub
Publisher: Packt Publishing


Now we are ready to create jobs. Since all of them will work in (more or less) the same way, we can use a single template that will serve for all our jobs related with service deployments. We need to create a separate directory for each job, apply the template, copy the result to the destination server and, finally, if any of the jobs changed, reload Jenkins. Unlike plugins that require a full restart, Jenkins will start using new jobs after the reload which is a very fast (almost instantaneous) action:

- name: Job directories are present file: path: "{{ home }}/jobs/{{ item.name }}" state: directory mode: 0777 with_items: jobs tags: [jenkins] - name: Jobs are present template: src: "{{ item.src }}" dest: "{{ home }}/jobs/{{ item.name }}/config.xml" mode: 0777 with_items: jobs register: jobs_result tags: [jenkins] - name: Jenkins is reloaded uri: url: http://{{ ip }}:8080/reload method: POST status_code: 200,302 when: jobs_result|changed ignore_errors: yes tags: [jenkins]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.