blob: 707e12874a5acda0824136208dc37b205f783c8c [file] [log] [blame]
Hung-Wei Chiu80dc18d2020-10-20 23:56:46 +00001---
2- name: Configure proxy config for Jenkins
3 template:
4 src: proxy.xml
5 dest: "{{ jenkins_home }}/proxy.xml"
6 owner: "{{ jenkins_process_user }}"
7 group: "{{ jenkins_process_group }}"
8 mode: 0664
9 register: jenkins_proxy_config
10 when:
11 - jenkins_proxy_host | length > 0
12 - jenkins_proxy_port | length > 0
13
14- name: Modify variables in init file.
15 lineinfile:
16 dest: "{{ jenkins_init_file }}"
17 insertafter: '^{{ item.option }}='
18 regexp: '^{{ item.option }}=\"\${{ item.option }} '
19 line: '{{ item.option }}="${{ item.option }} {{ item.value }}"'
20 state: present
21 mode: 0644
22 with_items: "{{ jenkins_init_changes }}"
23 register: jenkins_init_prefix
24
25- name: Create custom init scripts directory.
26 file:
27 path: "{{ jenkins_home }}/init.groovy.d"
28 state: directory
29 owner: "{{ jenkins_process_user }}"
30 group: "{{ jenkins_process_group }}"
31 mode: 0775