ansible/roles/utilizadores/tasks/main.yml

46 lines
878 B
YAML

---
# Grupo ansoladm
- name: Create group 'ansoladm'
group:
name: ansoladm
state: present
- name: 'Allow ansoladm users to sudo without a password'
lineinfile:
dest: '/etc/sudoers'
state: 'present'
regexp: '^%ansoladm'
line: '%ansoladm ALL=(ALL) NOPASSWD: ALL'
# Tiago Carrondo
- name: Add user 'tc'
become: true
user:
name: tc
shell: /bin/bash
groups: ansoladm
append: yes
- name: Add 'tc' authorized keys
become: true
authorized_key:
user: tc
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