cleanuo
This commit is contained in:
parent
0dc7c83d8e
commit
cb1a17de44
2 changed files with 23 additions and 23 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: "maintainer"
|
author: invalidplayername
|
||||||
description: "Create groups and users based on `accounts_groups` and `accounts_users` variables"
|
description: "Create groups and users based on `accounts_groups` and `accounts_users` variables"
|
||||||
license: MIT
|
license: MIT
|
||||||
min_ansible_version: 2.9
|
min_ansible_version: 2.9
|
||||||
|
|
|
||||||
|
|
@ -25,26 +25,26 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
|
||||||
- name: Create missing users declared as group members (optional)
|
# - name: Create missing users declared as group members (optional)
|
||||||
ansible.builtin.user:
|
# ansible.builtin.user:
|
||||||
name: "{{ item.1 }}"
|
# name: "{{ item.1 }}"
|
||||||
state: present
|
# state: present
|
||||||
when: create_missing_users | default(false) and item.0.state | default('present') == 'present'
|
# when: create_missing_users | default(false) and item.0.state | default('present') == 'present'
|
||||||
with_subelements:
|
# with_subelements:
|
||||||
- "{{ accounts_groups | default([]) }}"
|
# - "{{ accounts_groups | default([]) }}"
|
||||||
- members
|
# - members
|
||||||
loop_control:
|
# loop_control:
|
||||||
label: "{{ item.0.name }}:{{ item.1 }}"
|
# label: "{{ item.0.name }}:{{ item.1 }}"
|
||||||
|
|
||||||
- name: Ensure declared group members exist in their groups (only for present groups)
|
# - name: Ensure declared group members exist in their groups (only for present groups)
|
||||||
ansible.builtin.user:
|
# ansible.builtin.user:
|
||||||
name: "{{ item.1 }}"
|
# name: "{{ item.1 }}"
|
||||||
groups: "{{ item.0.name }}"
|
# groups: "{{ item.0.name }}"
|
||||||
append: yes
|
# append: yes
|
||||||
state: present
|
# state: present
|
||||||
when: item.0.state | default('present') == 'present'
|
# when: item.0.state | default('present') == 'present'
|
||||||
with_subelements:
|
# with_subelements:
|
||||||
- "{{ accounts_groups | default([]) }}"
|
# - "{{ accounts_groups | default([]) }}"
|
||||||
- members
|
# - members
|
||||||
loop_control:
|
# loop_control:
|
||||||
label: "{{ item.0.name }}:{{ item.1 }}"
|
# label: "{{ item.0.name }}:{{ item.1 }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue