Mount homeassistant data into restic for external backup

This commit is contained in:
Jake Howard
2021-11-21 21:53:35 +00:00
parent 47bcbd855e
commit eed75d8648
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,29 @@
- name: Install CIFS utils
package:
name: cifs-utils
become: true
- name: Create dir for CIFS mount
file:
path: /mnt/home-assistant
state: directory
mode: "0755"
become: true
- name: Create dir for each CIFS mount
file:
path: /mnt/home-assistant/{{ item }}
state: directory
mode: "0600"
become: true
loop: "{{ restic_homeassistant_mounts }}"
- name: Create mounts
mount:
path: /mnt/home-assistant/{{ item }}
fstype: cifs
opts: username=homeassistant,password=homeassistant
src: //{{ pve_hosts.homeassistant.ip }}/{{ item }}
state: mounted
become: true
loop: "{{ restic_homeassistant_mounts }}"

View File

@ -90,3 +90,7 @@
mode: "0600"
become: true
when: ansible_os_family == 'Archlinux'
- name: Install HomeAssistant mounts
include_tasks: homeassistant.yml
when: ansible_hostname == 'pve-restic'