xoxys.users/tasks/users_default.yml
Robert Kaussow 8cf8a0220e
All checks were successful
continuous-integration/drone/push Build is passing
fix formatting
2019-11-03 20:26:53 +01:00

21 lines
655 B
YAML

---
- block:
- name: Create common groups
group:
name: "{{ item }}"
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 | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) if item.password is defined else omit }}"
shell: "{{ item.shell | default('/bin/bash') }}"
loop: "{{ users_default_users }}"
loop_control:
label: "{{ item.name }}"
become: True
become_user: root