2022-03-01 23:30:08 +00:00
|
|
|
---
|
|
|
|
- name: Preps Playbook
|
|
|
|
hosts: lxd_hosts
|
|
|
|
become: true
|
|
|
|
roles:
|
|
|
|
- fail2ban
|
2022-03-03 22:43:23 +00:00
|
|
|
- utilizadores
|
2022-03-01 23:30:08 +00:00
|
|
|
tasks:
|
|
|
|
- name: PREPS -- install needed packages
|
|
|
|
become: true
|
|
|
|
package:
|
|
|
|
state: present
|
|
|
|
name: '{{ item }}'
|
|
|
|
with_items:
|
|
|
|
- unattended-upgrades
|
|
|
|
- zfsutils-linux # needed for lxd
|
|
|
|
- name: PREPS -- install lxd snap
|
|
|
|
become: true
|
|
|
|
snap:
|
|
|
|
name: lxd
|
|
|
|
- name: Add user 'git'
|
|
|
|
become: true
|
|
|
|
user:
|
|
|
|
name: git
|
2022-03-07 19:53:09 +00:00
|
|
|
groups:
|
|
|
|
- lxd
|
|
|
|
- name: PREPS -- git authorized keys
|
|
|
|
copy:
|
|
|
|
src: 'files/sshd_config'
|
|
|
|
dest: '/etc/ssh/sshd_config'
|
|
|
|
mode: 0644
|
|
|
|
notify:
|
|
|
|
- reload sshd
|
|
|
|
- name: PREPS -- git host shim
|
|
|
|
copy:
|
|
|
|
src: 'files/git_host_shim'
|
|
|
|
dest: '/usr/local/bin/gitea'
|
|
|
|
mode: 0755
|
|
|
|
handlers:
|
|
|
|
- name: reload sshd
|
|
|
|
service:
|
|
|
|
name: sshd
|
|
|
|
state: reloaded
|