Skip to content

Commit

Permalink
feat: add support to change default owner and group when calling jenk…
Browse files Browse the repository at this point in the history
…ins_plugin module (#15)

* 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

* docs: missing end .

---------

Co-authored-by: Tobias Richter <[email protected]>
  • Loading branch information
Jordi-Pineiro and tobias-richter authored Sep 22, 2023
1 parent cb833c6 commit 7bbf8c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7bbf8c9

Please sign in to comment.