Skip to content

Commit

Permalink
add members add inside groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayfly277 committed Nov 6, 2023
1 parent 0acb0f7 commit 7db7a04
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ansible/roles/ad/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- name: users
import_tasks: users.yml

# Managed BY
- name: Assign managed_by domainlocal groups
win_domain_group:
name: "{{ item.key }}"
Expand All @@ -34,3 +35,25 @@
managed_by: "{{ item.value.managed_by }}"
with_dict: "{{ ad_groups['global'] }}"
when: ad_groups['global'] is defined and item.value.managed_by is defined

# Add members
- name: Add members to the Universal group, preserving existing membership
community.windows.win_domain_group_membership:
name: "{{ item.key }}"
members: "{{ item.value.members }}"
with_dict: "{{ ad_groups['universal'] }}"
when: ad_groups['universal'] is defined and item.value.members is defined

- name: Add members to the Global group, preserving existing membership
community.windows.win_domain_group_membership:
name: "{{ item.key }}"
members: "{{ item.value.members }}"
with_dict: "{{ ad_groups['global'] }}"
when: ad_groups['global'] is defined and item.value.members is defined

- name: Add members to the Domainlocal group, preserving existing membership
community.windows.win_domain_group_membership:
name: "{{ item.key }}"
members: "{{ item.value.members }}"
with_dict: "{{ ad_groups['domainlocal'] }}"
when: ad_groups['domainlocal'] is defined and item.value.members is defined

0 comments on commit 7db7a04

Please sign in to comment.