xoxys.users/tasks/users_univention.yml
Robert Kaussow be00f66346
Some checks failed
continuous-integration/drone/push Build is failing
fix variable names
2019-11-03 18:48:04 +01:00

25 lines
792 B
YAML

---
- block:
# use system users and groups to prevent duplicate ids
# this is a workaround because udm_user not working
- name: Create common groups
group:
name: "{{ item }}"
system: 'yes'
state: present
loop: "{{ users_default_groups }}"
- name: Create common users
user:
name: "{{ item.name }}"
groups: "{{ item.groups | default([]) | join(',') or omit }}"
append: yes
password: "{{ item.password | default(omit) | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) }}"
shell: "{{ item.shell | default('/bin/bash') }}"
system: 'yes'
loop: "{{ users_default_users }}"
loop_control:
label: "{{ item.name }}"
become: True
become_user: root