Skip to content

Commit

Permalink
add options to roles role (redhat-cop#597)
Browse files Browse the repository at this point in the history
Co-authored-by: David Danielsson <[email protected]>
  • Loading branch information
2 people authored and Przemyslaw Kalitowski committed Nov 22, 2024
1 parent e9daf65 commit 5c54b36
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/roles_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- added option to roles role to support upcoming change to allow lists of teams and users to be used in the module.
...
5 changes: 5 additions & 0 deletions roles/roles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ This also speeds up the overall role.
|Variable Name|Default Value|Required|Type|Description|
|:---:|:---:|:---:|:---:|:---:|
|`user`|""|no|str|The user for which the role applies|
|`users`|""|no|list|The users for which the role applies|
|`team`|""|no|str|The team for which the role applies|
|`teams`|""|no|list|The teams for which the role applies|
|`role`|""|no|str (see note below)|The role which is applied to one of {`target_team`, `inventory`, `job_template`, `target_team`, `inventory`, `job_template`} for either `user` or `team` |
|`target_team`|""|no|str|The team the role applies against|
|`target_teams`|""|no|list|The teams the role applies against|
Expand Down Expand Up @@ -140,6 +142,9 @@ This also speeds up the overall role.
---
controller_roles:
- user: jdoe
users:
- thing1
- thing2
target_team: "My Team"
role: member
- team: "My Team"
Expand Down
2 changes: 2 additions & 0 deletions roles/roles/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
- name: Create Role Based Access Entry on Controller
role:
user: "{{ __controller_role_item.user | default(omit, true) }}"
users: "{{ __controller_role_item.user | default(( [] if controller_configuration_role_enforce_defaults else omit), true) }}"
team: "{{ __controller_role_item.team | default(omit, true) }}"
teams: "{{ __controller_role_item.team | default(( [] if controller_configuration_role_enforce_defaults else omit), true) }}"
role: "{{ __controller_role_item.role | mandatory }}"
target_team: "{{ __controller_role_item.target_team | default(omit, true) }}"
target_teams: "{{ __controller_role_item.target_teams | default(( [] if controller_configuration_role_enforce_defaults else omit), true) }}"
Expand Down

0 comments on commit 5c54b36

Please sign in to comment.