diff --git a/playbooks/tasks/services/b-user/service-user/01-user.d/data/cloud.yml b/playbooks/tasks/services/b-user/service-user/01-user.d/data/cloud.yml index c9c6b15..cbfcd4a 100644 --- a/playbooks/tasks/services/b-user/service-user/01-user.d/data/cloud.yml +++ b/playbooks/tasks/services/b-user/service-user/01-user.d/data/cloud.yml @@ -6,7 +6,7 @@ group: "{{ service_user_name }}" mode: 0755 -- name: Create data directory for user {{ service_user_name }} +- name: Create nextcloud directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud" state: directory @@ -14,13 +14,20 @@ group: "{{ service_user_name }}" mode: 0755 -- name: Create data mount directory for user {{ service_user_name }} +- name: Check if nextcloud mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud/_data" + register: nextcloud_mount_directory + +- name: Create nextcloud mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud/_data" state: directory owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not nextcloud_mount_directory.stat.exists - name: Create data directory for user {{ service_user_name }} file: @@ -30,6 +37,11 @@ group: "{{ service_user_name }}" mode: 0755 +- name: Check if data mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data" + register: data_mount_directory + - name: Create data mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data" @@ -37,3 +49,5 @@ owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not data_mount_directory.stat.exists diff --git a/playbooks/tasks/services/b-user/service-user/01-user.d/data/database.yml b/playbooks/tasks/services/b-user/service-user/01-user.d/data/database.yml index 25cc8d8..27aac8f 100644 --- a/playbooks/tasks/services/b-user/service-user/01-user.d/data/database.yml +++ b/playbooks/tasks/services/b-user/service-user/01-user.d/data/database.yml @@ -14,6 +14,11 @@ group: "{{ service_user_name }}" mode: 0755 +- name: Check if wal mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal/_data" + register: wal_mount_directory + - name: Create wal mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal/_data" @@ -21,6 +26,8 @@ owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not wal_mount_directory.stat.exists - name: Create data directory for user {{ service_user_name }} file: @@ -30,6 +37,11 @@ group: "{{ service_user_name }}" mode: 0755 +- name: Check if data mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data" + register: data_mount_directory + - name: Create data mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data" @@ -37,3 +49,5 @@ owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not data_mount_directory.stat.exists diff --git a/playbooks/tasks/services/b-user/service-user/01-user.d/data/lrproxy.yml b/playbooks/tasks/services/b-user/service-user/01-user.d/data/lrproxy.yml index e081d39..2fcf9c3 100644 --- a/playbooks/tasks/services/b-user/service-user/01-user.d/data/lrproxy.yml +++ b/playbooks/tasks/services/b-user/service-user/01-user.d/data/lrproxy.yml @@ -14,6 +14,11 @@ group: "{{ service_user_name }}" mode: 0755 +- name: Check if etc-letsencrypt mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data" + register: etc_letsencrypt_mount_directory + - name: Create etc-letsencrypt mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data" @@ -21,3 +26,5 @@ owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not etc_letsencrypt_mount_directory.stat.exists diff --git a/playbooks/tasks/services/b-user/service-user/01-user.d/data/rproxy.yml b/playbooks/tasks/services/b-user/service-user/01-user.d/data/rproxy.yml index e081d39..2fcf9c3 100644 --- a/playbooks/tasks/services/b-user/service-user/01-user.d/data/rproxy.yml +++ b/playbooks/tasks/services/b-user/service-user/01-user.d/data/rproxy.yml @@ -14,6 +14,11 @@ group: "{{ service_user_name }}" mode: 0755 +- name: Check if etc-letsencrypt mount directory exists for user {{ service_user_name }} + stat: + path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data" + register: etc_letsencrypt_mount_directory + - name: Create etc-letsencrypt mount directory for user {{ service_user_name }} file: path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data" @@ -21,3 +26,5 @@ owner: "{{ service_user_name }}" group: "{{ service_user_name }}" mode: 0755 + when: + not etc_letsencrypt_mount_directory.stat.exists