SYNO: add automounts

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
Frank Villaro-Dixon 2024-10-22 14:56:54 +02:00
parent 6e43a53bff
commit 492388011e
3 changed files with 37 additions and 4 deletions

View file

@ -21,20 +21,33 @@
- mnt-syno-k8home - mnt-syno-k8home
register: systemd_mount register: systemd_mount
- name: Copy automount files
ansible.builtin.copy:
src: files/{{item}}.automount
dest: /etc/systemd/system/{{item}}.automount
owner: root
group: root
mode: 0644
with_items:
- mnt-syno-InfraBackups
- mnt-syno-k8home
register: systemd_automount
- name: Reload systemd - name: Reload systemd
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: yes daemon_reload: yes
when: systemd_mount.changed when: systemd_mount.changed or systemd_automount.changed
- name: Start & Enable systemd mount - name: Start & Enable systemd automounts
ansible.builtin.systemd: ansible.builtin.systemd:
name: "{{item}}.mount" name: "{{item}}.automount"
state: started state: started
enabled: yes enabled: yes
with_items: with_items:
- mnt-syno-InfraBackups - mnt-syno-InfraBackups
- mnt-syno-k8home - mnt-syno-k8home
when: systemd_mount.changed when: systemd_automount.changed
- name: Generate ssh key - name: Generate ssh key

View file

@ -0,0 +1,10 @@
[Unit]
Description=Automount InfraBackups
After=network-online.target
Wants=network-online.target
[Automount]
Where=/mnt/syno/InfraBackups
[Install]
WantedBy=remote-fs.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=Automount k8home
After=network-online.target
Wants=network-online.target
[Automount]
Where=/mnt/syno/k8home
[Install]
WantedBy=remote-fs.target