Skip to content

Commit

Permalink
add options to roles role
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-m-sullivan committed May 6, 2023
1 parent 6f3b480 commit bb84be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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 bb84be0

Please sign in to comment.