diff --git a/roles/utilizadores/tasks/main.yml b/roles/utilizadores/tasks/main.yml new file mode 100644 index 0000000..e73d5a3 --- /dev/null +++ b/roles/utilizadores/tasks/main.yml @@ -0,0 +1,45 @@ +--- +# 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