This commit is contained in:
2020-09-24 03:00:03 +02:00
parent 06523efab1
commit 2b974f738c
11 changed files with 52 additions and 0 deletions

22
roles/sudo_users/tasks/main.yml Executable file
View File

@ -0,0 +1,22 @@
- name: Ensure allow_ssh-group exists
group:
name: allow_ssh
state: present
- name: Ensure sudo users present
user:
name: "{{ item }}"
groups: sudo,allow_ssh
home: "/home/{{ item }}"
shell: /bin/bash
state: present
password: '{{ passwords[item] }}'
update_password: on_create
with_items: '{{ sudo_users }}'
notify: Ensure password change reminder present
- name: Ensure public keys in authorized_keys
authorized_key:
user: "{{ item }}"
key: "{{ lookup('file', 'public_keys/' + item + '.pub') }}"
with_items: '{{ sudo_users }}'