SYNO: add automounts
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
parent
6e43a53bff
commit
492388011e
3 changed files with 37 additions and 4 deletions
|
@ -21,20 +21,33 @@
|
|||
- mnt-syno-k8home
|
||||
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
|
||||
ansible.builtin.systemd:
|
||||
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:
|
||||
name: "{{item}}.mount"
|
||||
name: "{{item}}.automount"
|
||||
state: started
|
||||
enabled: yes
|
||||
with_items:
|
||||
- mnt-syno-InfraBackups
|
||||
- mnt-syno-k8home
|
||||
when: systemd_mount.changed
|
||||
when: systemd_automount.changed
|
||||
|
||||
|
||||
- name: Generate ssh key
|
||||
|
|
10
ansible/files/mnt-syno-InfraBackups.automount
Normal file
10
ansible/files/mnt-syno-InfraBackups.automount
Normal 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
|
10
ansible/files/mnt-syno-k8home.automount
Normal file
10
ansible/files/mnt-syno-k8home.automount
Normal 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
|
Loading…
Reference in a new issue