change backup location

This commit is contained in:
Pim Kunis 2023-05-15 22:19:34 +02:00
parent 914a192f79
commit ed2ce14258
4 changed files with 18 additions and 10 deletions

View file

@ -1,5 +1,5 @@
[defaults] [defaults]
roles_path=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles roles_path=~/.ansible/roles:roles:/usr/share/ansible/roles:/etc/ansible/roles
inventory=inventory inventory=inventory
vault_password_file=util/secret-service-client.sh vault_password_file=util/secret-service-client.sh
interpreter_python=/usr/bin/python3 interpreter_python=/usr/bin/python3

View file

@ -1,5 +1,5 @@
kingston1tb_mount_point: "/mnt/kingston1TB" backup_mount_point: "/mnt/backups"
kingston1tb_uuid: "622a8d81-aa2f-460b-a563-c3cdb6285609" backup_uuid: "622a8d81-aa2f-460b-a563-c3cdb6285609"
admin_public_keys: admin_public_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop"
@ -20,3 +20,5 @@ deploy_ssh_certificates:
key_type: ed25519 key_type: ed25519
signing_key: hyp_host signing_key: hyp_host
host: lewis.hyp host: lewis.hyp
docker_repository: ubuntu

View file

@ -26,24 +26,24 @@
- name: Ensure backup directory exists - name: Ensure backup directory exists
file: file:
path: "{{ kingston1tb_mount_point }}/hosts" path: "{{ backup_mount_point }}/hosts"
state: directory state: directory
- name: Create backup respositories - name: Create backup respositories
command: command:
cmd: "borg init -e none {{ kingston1tb_mount_point }}/hosts/{{ item }}" cmd: "borg init -e none {{ backup_mount_point }}/hosts/{{ item }}"
creates: "{{ kingston1tb_mount_point }}/hosts/{{ item }}" creates: "{{ backup_mount_point }}/hosts/{{ item }}"
with_items: "{{ backup_hosts }}" with_items: "{{ backup_hosts }}"
- name: Create extra disk moint point - name: Create extra disk moint point
file: file:
path: "{{ kingston1tb_mount_point }}" path: "{{ backup_mount_point }}"
state: directory state: directory
- name: Mount extra disk - name: Mount extra disk
ansible.posix.mount: mount:
path: "{{ kingston1tb_mount_point }}" path: "{{ backup_mount_point }}"
src: "UUID={{ kingston1tb_uuid }}" src: "UUID={{ backup_uuid }}"
fstype: ext4 fstype: ext4
passno: 1 passno: 1
state: present state: present
@ -51,3 +51,6 @@
roles: roles:
- {role: apt, tags: apt} - {role: apt, tags: apt}
- {role: deploy_ssh_certificates, tags: deploy_ssh_certificates} - {role: deploy_ssh_certificates, tags: deploy_ssh_certificates}
# - {role: docker, tags: docker}
# - {role: uptime_kuma, tags: uptime_kuma}
# - {role: alerts, tags: alerts}

View file

@ -4,3 +4,6 @@
- name: deploy_ssh_certificates - name: deploy_ssh_certificates
src: https://git.pim.kunis.nl/home/ansible-role-deploy-ssh-certificates src: https://git.pim.kunis.nl/home/ansible-role-deploy-ssh-certificates
scm: git scm: git
- name: docker
src: https://git.pim.kunis.nl/pim/ansible-role-docker
scm: git