More content and playbooks
* more readme.md content * imported basic roles * commented said basic roles * trimmed down playbooks to be understandable * update requirements.txt deps
This commit is contained in:
parent
23b521f4fb
commit
2a067a2fe4
22 changed files with 491 additions and 0 deletions
28
roles/root_user/tasks/main.yml
Normal file
28
roles/root_user/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
# Ensures the .ssh directory exists
|
||||
- name: "creates the .ssh root directory"
|
||||
file:
|
||||
path: "/root/.ssh"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0700
|
||||
- name: "Install root SSH keys"
|
||||
template:
|
||||
src: authorized_keys.j2
|
||||
dest: /root/.ssh/authorized_keys
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
# Delete users you don't need
|
||||
# respectively you can also *add* users
|
||||
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html#ansible-collections-ansible-builtin-user-module
|
||||
- name: "Delete usual cloud users user"
|
||||
user:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
remove: true
|
||||
with_items:
|
||||
- pi
|
||||
- admin
|
||||
- ubuntu
|
4
roles/root_user/templates/authorized_keys.j2
Normal file
4
roles/root_user/templates/authorized_keys.j2
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% for key in root_user.default_root_keys %}
|
||||
# {{ key.name }}
|
||||
{{ key.key }}
|
||||
{% endfor %}
|
Loading…
Add table
Add a link
Reference in a new issue