primeira versão da role

This commit is contained in:
Tiago Carrondo 2022-03-03 22:43:09 +00:00
parent ca802e834e
commit dd89fb3261
1 changed files with 45 additions and 0 deletions

View File

@ -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