From f32153e81cd3ab940ff630115039d49b6025bd0e Mon Sep 17 00:00:00 2001 From: Jordi-Pineiro Date: Thu, 21 Sep 2023 12:12:12 +0200 Subject: [PATCH 1/2] feat: add support to change default owner and group when calling jenkins_plugin module. This adds support to use the role with Jenkins running on a docker container --- README.md | 8 ++++++++ defaults/main.yml | 6 ++++++ tasks/main.yml | 2 ++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index ebfcba6..23491f2 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,14 @@ The update center proxy no proxy hosts list. Controls if the initial setup of the jenkins instance should be completed. This may be necessary in proxy environments where the jenkins instance still thinks it is in offline mode. + jenkins_plugins_owner: "jenkins" + +User owning the files in the plugins folder + + jenkins_plugins_group: "jenkins" + +Group owning the files in the plugins folder + ## Dependencies This role depends on the diff --git a/defaults/main.yml b/defaults/main.yml index 5df88cc..9b1da70 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -75,3 +75,9 @@ jenkins_plugins_proxy_no_proxy_hosts: [] # Controls if the initial setup of the jenkins instance should be completed. # This may be necessary in proxy environments where the jenkins instance still thinks it is in offline mode jenkins_plugins_complete_initial_setup: false + +# Owner of the files in the jenkins plugins folder +jenkins_plugins_owner: "jenkins" + +# Group of the files in the jenkins plugin folder +jenkins_plugins_group: "{{ jenkins_plugins_owner }}" diff --git a/tasks/main.yml b/tasks/main.yml index 81db827..6c1de5f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -88,6 +88,8 @@ updates_url: "{{ jenkins_plugins_download_base_url }}" updates_expiration: "{{ jenkins_plugins_updates_expiration }}" url: "{{ jenkins_plugins_jenkins_base_url }}" + owner: "{{ jenkins_plugins_owner }}" + group: "{{ jenkins_plugins_group }}" with_dict: "{{ jenkins_plugins_install_plugins | default({}) }}" changed_when: jenkins_plugins_install_plugins | default({}) | length > 0 notify: From 1d27a6df8783a5e6c3a00d55710d16e42ecf3e28 Mon Sep 17 00:00:00 2001 From: Jordi-Pineiro Date: Fri, 22 Sep 2023 11:52:07 +0200 Subject: [PATCH 2/2] docs: missing end . --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 23491f2..2216afe 100644 --- a/README.md +++ b/README.md @@ -122,11 +122,11 @@ This may be necessary in proxy environments where the jenkins instance still thi jenkins_plugins_owner: "jenkins" -User owning the files in the plugins folder +User owning the files in the plugins folder. jenkins_plugins_group: "jenkins" -Group owning the files in the plugins folder +Group owning the files in the plugins folder. ## Dependencies