Skip to content

Commit 0e7d9ba

Browse files
Merge pull request #14 from wcm-io-devops/feature/update_jenkins_2.346.2
Raise plugin- and/or role versions
2 parents 295fed6 + a7d6dc5 commit 0e7d9ba

File tree

7 files changed

+31
-30
lines changed

7 files changed

+31
-30
lines changed

defaults/main.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jenkins_casc_config_path_configure: false
3535
# Config files/templates to upload
3636
jenkins_casc_config_fileglobs: []
3737

38-
# Controls if files that existing files in the 'jenkins_casc_config_path' are deleted when they are not included in the 'jenkins_casc_config_fileglobs'
39-
# Deletion will only be executed when at least one file was uploaded to the 'jenkins_casc_config_path'
38+
# Controls if files that existing files in the 'jenkins_casc_config_path' are deleted
39+
# when they are not included in the 'jenkins_casc_config_fileglobs'. Deletion will only
40+
# be executed when at least one file was uploaded to the 'jenkins_casc_config_path'
4041
jenkins_casc_config_unmanaged_delete: false
4142

4243
# The timeout for jenkins_script tasks in seconds
@@ -48,13 +49,13 @@ jenkins_casc_no_log: true
4849
# Plugins needed for configuration-as-code
4950
jenkins_casc_plugins_present:
5051
- name: configuration-as-code
51-
version: "1414.v878271fc496f"
52+
version: "1512.vb_79d418d5fc8"
5253
- name: configuration-as-code-groovy
5354
version: "1.1"
5455
- name: snakeyaml-api
55-
version: "1.29.1"
56+
version: "1.30.2-76.vc104f7ce9870"
5657
- name: job-dsl
57-
version: "1.78.3"
58+
version: "1.81"
5859

5960
# Plugins no longer needed for configuration-as-code
6061
jenkins_casc_plugins_absent:

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ galaxy_info:
77
company: pro!vision
88
issue_tracker_url: https://wcm-io.atlassian.net
99
license: Apache
10-
min_ansible_version: 2.7
10+
min_ansible_version: "2.7"
1111

1212
platforms:
1313
- name: EL

tasks/configure.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
- name: "configure : check if '{{ jenkins_casc_config_path }}' exists."
3-
stat:
3+
ansible.builtin.stat:
44
path: "{{ jenkins_casc_config_path }}"
55
register: jenkins_casc_config_path_result
66

77
- name: "Fail when '{{ jenkins_casc_config_path }}' does not exist."
8-
fail:
8+
ansible.builtin.fail:
99
msg: >-
1010
No file or directory found with path '{{ jenkins_casc_config_path }}'.
1111
Ensure that the configuration is on the instance before calling this role."
@@ -26,12 +26,12 @@
2626
| regex_replace('\\s*Result:\\s*(.*)\\n*$', '\\1') | from_json).changed
2727

2828
- name: "configure : set _jenkins_casc_plugin_configure_result fact."
29-
set_fact:
29+
ansible.builtin.set_fact:
3030
_jenkins_casc_plugin_configure_result:
3131
"{{ (_jenkins_casc_plugin_configure_result.output | regex_replace('\\s*Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"
3232

3333
- name: "configure : fail when configuration throws exception."
34-
fail:
34+
ansible.builtin.fail:
3535
msg:
3636
- Exception thrown during applying of configuration, check your configuration!
3737
- "{{ _jenkins_casc_plugin_configure_result.msg }}"

tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
- include_tasks: secrets.yml
2+
- ansible.builtin.include_tasks: secrets.yml
33
tags:
44
- jcasc-secrets
55
when: jenkins_casc_secrets | length > 0
66

7-
- include_tasks: upload.yml
7+
- ansible.builtin.include_tasks: upload.yml
88
tags:
99
- jcasc-upload
1010

11-
- include_tasks: configure.yml
11+
- ansible.builtin.include_tasks: configure.yml
1212
tags:
1313
- jcasc-configure
1414
when: jenkins_casc_config_path_configure
1515

1616
- name: "trigger reload handler when necessary."
17-
command: /bin/true
17+
ansible.builtin.command: /bin/true
1818
changed_when: true
1919
when:
2020
# only trigger when configure result is false, since this will do a implicit reload

tasks/reload.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
- jcasc-reload
1414

1515
- name: "reload : set _jenkins_casc_upload_files_result fact."
16-
set_fact:
16+
ansible.builtin.set_fact:
1717
_jenkins_casc_upload_files_result:
1818
"{{ (_jenkins_casc_upload_files_result.output | regex_replace('\\s*Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"
1919

2020
- name: "reload : fail when configuration throws exception."
21-
fail:
21+
ansible.builtin.fail:
2222
msg:
2323
- Exception thrown during applying of configuration, check your configuration!
2424
- "{{ _jenkins_casc_upload_files_result.msg }}"

tasks/secrets.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
22
- name: "secrets : get user home dir."
33
become: yes
4-
getent:
4+
ansible.builtin.getent:
55
database: passwd
66
key: "{{ jenkins_casc_owner }}"
77
split: ":"
88

99
- name: "secrets : set user home dir."
10-
set_fact:
10+
ansible.builtin.set_fact:
1111
_secrets_home_dir: "{{ getent_passwd[jenkins_casc_owner][4] }}"
1212
failed_when: _secrets_home_dir | length == 0
1313

1414
- name: "secrets : create secrets dir."
15-
file:
15+
ansible.builtin.file:
1616
path: "{{ jenkins_casc_secrets_dir }}"
1717
state: directory
1818
owner: "{{ jenkins_casc_owner }}"
1919
group: "{{ jenkins_casc_group }}"
2020
mode: 0700
2121

2222
- name: "secrets : deploy secret."
23-
copy:
23+
ansible.builtin.copy:
2424
dest: "{{ jenkins_casc_secrets_dir }}/{{ secret.id }}"
2525
content: "{{ secret.value }}"
2626
owner: "{{ jenkins_casc_owner }}"
@@ -34,12 +34,12 @@
3434
- name: "secrets : unmanaged."
3535
block:
3636
- name: "secrets : unmanaged : find files in {{ jenkins_casc_secrets_dir }}."
37-
find:
37+
ansible.builtin.find:
3838
paths: "{{ jenkins_casc_secrets_dir }}"
3939
register: _jenkins_casc_secrets_existing_files
4040

4141
- name: "secrets : unmanaged : delete unmanaged secrets."
42-
file:
42+
ansible.builtin.file:
4343
path: "{{ jenkins_casc_secrets_dir }}/{{ item }}"
4444
state: absent
4545
with_items: "{{ _jenkins_casc_secrets_existing_files.files | map(attribute='path') | map('basename') | list
@@ -48,7 +48,7 @@
4848
when: jenkins_casc_secrets_unmanaged_delete
4949

5050
- name: "secrets : configure secrets env var."
51-
blockinfile:
51+
ansible.builtin.blockinfile:
5252
dest: "{{ _secrets_home_dir }}/.profile"
5353
create: yes
5454
owner: "{{ jenkins_casc_owner }}"
@@ -60,7 +60,7 @@
6060
register: _profile_result
6161

6262
- name: Restart Jenkins when required. # noqa 503
63-
include_role:
63+
ansible.builtin.include_role:
6464
name: wcm_io_devops.jenkins_service
6565
vars:
6666
jenkins_service_state: "restarted"

tasks/upload.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
- name: "upload : calculate files to upload order to check that no files exist with overlapping names."
3-
set_fact:
3+
ansible.builtin.set_fact:
44
_jenkins_casc_found_config_files: "{{ _jenkins_casc_found_config_files | default([]) + [item] }}"
55
with_fileglob: "{{ jenkins_casc_config_fileglobs }}"
66

77
- name: "upload : fail on overlapping file names."
8-
fail:
8+
ansible.builtin.fail:
99
msg:
1010
- "Found duplicate file(s) to deploy!"
1111
- "Please ensure that the filenames are unique, otherwise unexpected result may occur!"
@@ -15,15 +15,15 @@
1515
_jenkins_casc_found_config_files | default({}) | map('basename') | list | unique
1616

1717
- name: "upload : create configuration dir."
18-
file:
18+
ansible.builtin.file:
1919
path: "{{ jenkins_casc_config_path }}"
2020
state: directory
2121
owner: "{{ jenkins_casc_owner }}"
2222
group: "{{ jenkins_casc_group }}"
2323
mode: 0770
2424

2525
- name: "upload : upload files/templates."
26-
template:
26+
ansible.builtin.template:
2727
src: "{{ item }}"
2828
owner: "{{ jenkins_casc_owner }}"
2929
group: "{{ jenkins_casc_group }}"
@@ -35,12 +35,12 @@
3535
- name: "upload : unmanaged."
3636
block:
3737
- name: "upload : unmanaged : find files in {{ jenkins_casc_config_path }}."
38-
find:
38+
ansible.builtin.find:
3939
paths: "{{ jenkins_casc_config_path }}"
4040
register: _jenkins_casc_config_existing_files
4141

4242
- name: "upload : unmanaged : delete unmanaged files."
43-
file:
43+
ansible.builtin.file:
4444
path: "{{ item }}"
4545
state: absent
4646
# build list of uploaded and found file paths and delete the difference

0 commit comments

Comments
 (0)