36 lines
704 B
YAML
36 lines
704 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'
|
|
|
|
# Utilizadores e chaves
|
|
|
|
- name: Add user(s)
|
|
become: true
|
|
user:
|
|
name: '{{ item.name }}'
|
|
shell: /bin/bash
|
|
groups:
|
|
- ansoladm
|
|
- lxd
|
|
append: yes
|
|
with_items:
|
|
- '{{utilizadores}}'
|
|
- name: Add authorized key(s)
|
|
become: true
|
|
authorized_key:
|
|
user: '{{ item.name }}'
|
|
state: present
|
|
key: https://github.com/{{ item.github }}.keys
|
|
with_items:
|
|
- '{{utilizadores}}'
|