less is more

This commit is contained in:
Tiago Carrondo 2022-03-03 23:11:02 +00:00
parent 62a4d1b470
commit 1f672dbfeb
2 changed files with 16 additions and 22 deletions

View File

@ -0,0 +1,6 @@
---
utilizadores:
- name: tc
github: tcarrondo
- name: hugopeixoto
github: hugopeixoto

View File

@ -12,34 +12,22 @@
regexp: '^%ansoladm'
line: '%ansoladm ALL=(ALL) NOPASSWD: ALL'
# Tiago Carrondo
# Utilizadores e chaves
- name: Add user 'tc'
- name: Add user(s)
become: true
user:
name: tc
name: '{{ item.name }}'
shell: /bin/bash
groups: ansoladm
append: yes
- name: Add 'tc' authorized keys
with_items:
- '{{utilizadores}}'
- name: Add authorized key(s)
become: true
authorized_key:
user: tc
user: '{{ item.name }}'
state: present
key: https://github.com/tcarrondo.keys
# Hugo Peixoto
- name: Add user 'hugopeixoto'
become: true
user:
name: hugopeixoto
shell: /bin/bash
groups: ansoladm
append: yes
- name: Add 'hugopeixoto' authorized keys
become: true
authorized_key:
user: hugopeixoto
state: present
key: https://github.com/hugopeixoto.keys
key: https://github.com/{{ item.github }}.keys
with_items:
- '{{utilizadores}}'