Feat: add group creation for user

This commit is contained in:
Bertrand Benjamin 2022-05-18 11:22:18 +02:00
parent faedd20757
commit e95e6063f7

View File

@ -7,8 +7,10 @@
# Create user
- name: Ensure wheel group exists
group:
name: wheel
name: "{{ item }}"
state: present
with_items: "{{ user.groups | replace(' ', '') | split(',') }}"
- name: "{{ username }} -- create user "
ansible.builtin.user:
@ -22,15 +24,13 @@
system: "{{ user.system | default('no') }}"
create_home: true
#
- name: "{{ username }} -- Add public key"
authorized_key:
user: "{{ user.username }}"
authorized_key:
user: "{{ user.username }}"
key: "{{ lookup('file', item.keyfile) }}"
state: present
with_items: "{{ user.public_key | default([]) }}"
# Dotfiles
- name: "{{ username }} -- set dotfiles"
import_tasks: dotfiles.yml