This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
lewis/ansible/playbooks/lewis.yml

53 lines
1.3 KiB
YAML

- name: Setup homeserver
hosts: dataserver
handlers:
- name: restart sshd
systemd:
name: sshd
state: restarted
tasks:
- name: Copy backup user principals file
copy:
dest: /etc/ssh/backup_principals
content: hypervisor
- name: Copy hyp user SSH CA public key
copy:
dest: /etc/ssh/hyp_user.pub
content: "{{ hyp_user_ca_public_key }}"
- name: Copy user certificate sshd config
copy:
src: "sshd_user_certificates.conf"
dest: /etc/ssh/sshd_config.d/user_certificates.conf
notify: restart sshd
- name: Ensure backup directory exists
file:
path: "{{ backup_mount_point }}/hosts"
state: directory
- name: Create backup respositories
command:
cmd: "borg init -e none {{ backup_mount_point }}/hosts/{{ item }}"
creates: "{{ backup_mount_point }}/hosts/{{ item }}"
with_items: "{{ backup_hosts }}"
- name: Create extra disk moint point
file:
path: "{{ backup_mount_point }}"
state: directory
- name: Mount extra disk
mount:
path: "{{ backup_mount_point }}"
src: "UUID={{ backup_uuid }}"
fstype: ext4
passno: 1
state: present
roles:
- {role: apt, tags: apt}
- {role: deploy_ssh_certificates, tags: deploy_ssh_certificates}