/
/
/
1---
2# NFS Remount Sequence - Stop services, remount NFS, restart services
3
4# Stop all services using docker_compose_v2
5- name: Stop Frigate service for NFS remount
6 community.docker.docker_compose_v2:
7 project_src: "{{ frigate_config_dir }}"
8 state: absent
9 when: frigate_enabled
10 ignore_errors: true
11
12- name: Stop Immich service for NFS remount
13 community.docker.docker_compose_v2:
14 project_src: "{{ immich_config_dir }}"
15 state: absent
16 when: immich_enabled
17 ignore_errors: true
18
19- name: Stop Forgejo service for NFS remount
20 community.docker.docker_compose_v2:
21 project_src: "{{ forgejo_config_dir }}"
22 state: absent
23 when: forgejo_enabled
24 ignore_errors: true
25
26- name: Stop Stirling-PDF service for NFS remount
27 community.docker.docker_compose_v2:
28 project_src: "{{ stirling_pdf_config_dir }}"
29 state: absent
30 when: stirling_pdf_enabled
31 ignore_errors: true
32
33- name: Stop Tandoor service for NFS remount
34 community.docker.docker_compose_v2:
35 project_src: "{{ tandoor_config_dir }}"
36 state: absent
37 when: tandoor_enabled
38 ignore_errors: true
39
40- name: Stop Ghost service for NFS remount
41 community.docker.docker_compose_v2:
42 project_src: "{{ ghost_config_dir }}"
43 state: absent
44 when: ghost_enabled
45 ignore_errors: true
46
47- name: Stop Harbor service for NFS remount (external deployment)
48 shell: |
49 cd {{ harbor_config_dir }} && docker compose down || docker-compose down || true
50 when: harbor_enabled
51 ignore_errors: true
52
53# Wait for graceful shutdown
54- name: Wait for services to shut down gracefully
55 pause:
56 seconds: 15
57
58# Unmount and remount NFS shares
59- name: Unmount existing NFS shares
60 shell: |
61 if mountpoint -q "{{ item.local_path }}"; then
62 echo "Unmounting {{ item.local_path }}"
63 umount "{{ item.local_path }}" || umount -f "{{ item.local_path }}" || true
64 fi
65 loop: "{{ runner_nfs_mounts }}"
66 become: true
67
68- name: Remount NFS shares with new options
69 shell: |
70 echo "Mounting {{ item.host }}:{{ item.nfs_path }} to {{ item.local_path }}"
71 mount -t nfs -o {{ item.options }} {{ item.host }}:{{ item.nfs_path }} {{ item.local_path }}
72 loop: "{{ runner_nfs_mounts }}"
73 become: true
74
75# Restart all services using docker_compose_v2
76- name: Restart Frigate service after NFS remount
77 community.docker.docker_compose_v2:
78 project_src: "{{ frigate_config_dir }}"
79 state: present
80 recreate: "always"
81 when: frigate_enabled
82
83- name: Restart Immich service after NFS remount
84 community.docker.docker_compose_v2:
85 project_src: "{{ immich_config_dir }}"
86 state: present
87 recreate: "always"
88 when: immich_enabled
89
90- name: Restart Forgejo service after NFS remount
91 community.docker.docker_compose_v2:
92 project_src: "{{ forgejo_config_dir }}"
93 state: present
94 recreate: "always"
95 when: forgejo_enabled
96
97- name: Restart Stirling-PDF service after NFS remount
98 community.docker.docker_compose_v2:
99 project_src: "{{ stirling_pdf_config_dir }}"
100 state: present
101 recreate: "always"
102 when: stirling_pdf_enabled
103
104- name: Restart Tandoor service after NFS remount
105 community.docker.docker_compose_v2:
106 project_src: "{{ tandoor_config_dir }}"
107 state: present
108 recreate: "always"
109 when: tandoor_enabled
110
111- name: Restart Ghost service after NFS remount
112 community.docker.docker_compose_v2:
113 project_src: "{{ ghost_config_dir }}"
114 state: present
115 recreate: "always"
116 when: ghost_enabled
117
118- name: Restart Harbor service after NFS remount (external deployment)
119 shell: |
120 cd {{ harbor_config_dir }} && docker compose up -d || docker-compose up -d || true
121 when: harbor_enabled
122 ignore_errors: true