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

54 lines
1.3 KiB
YAML
Raw Normal View History

2023-02-25 14:35:35 +00:00
- name: Setup homeserver
hosts: dataserver
2023-04-25 19:59:11 +00:00
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:
2023-05-15 20:19:34 +00:00
path: "{{ backup_mount_point }}/hosts"
2023-04-25 19:59:11 +00:00
state: directory
- name: Create backup respositories
command:
2023-05-15 20:19:34 +00:00
cmd: "borg init -e none {{ backup_mount_point }}/hosts/{{ item }}"
creates: "{{ backup_mount_point }}/hosts/{{ item }}"
2023-04-25 19:59:11 +00:00
with_items: "{{ backup_hosts }}"
- name: Create extra disk moint point
file:
2023-05-15 20:19:34 +00:00
path: "{{ backup_mount_point }}"
2023-04-25 19:59:11 +00:00
state: directory
- name: Mount extra disk
2023-05-15 20:19:34 +00:00
mount:
path: "{{ backup_mount_point }}"
src: "UUID={{ backup_uuid }}"
2023-04-25 19:59:11 +00:00
fstype: ext4
passno: 1
state: present
2023-02-25 14:35:35 +00:00
roles:
2023-04-26 17:39:36 +00:00
- {role: apt, tags: apt}
- {role: deploy_ssh_certificates, tags: deploy_ssh_certificates}