Prevent ownership change when mount dir exists
This commit is contained in:
parent
a3d318daa2
commit
baa6583484
@ -6,7 +6,7 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Create data directory for user {{ service_user_name }}
|
- name: Create nextcloud directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud"
|
||||||
state: directory
|
state: directory
|
||||||
@ -14,13 +14,20 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/nextcloud/_data"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not nextcloud_mount_directory.stat.exists
|
||||||
|
|
||||||
- name: Create data directory for user {{ service_user_name }}
|
- name: Create data directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
@ -30,6 +37,11 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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 }}
|
- name: Create data mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data"
|
||||||
@ -37,3 +49,5 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not data_mount_directory.stat.exists
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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 }}
|
- name: Create wal mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal/_data"
|
||||||
@ -21,6 +26,8 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not wal_mount_directory.stat.exists
|
||||||
|
|
||||||
- name: Create data directory for user {{ service_user_name }}
|
- name: Create data directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
@ -30,6 +37,11 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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 }}
|
- name: Create data mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data"
|
||||||
@ -37,3 +49,5 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not data_mount_directory.stat.exists
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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 }}
|
- name: Create etc-letsencrypt mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
||||||
@ -21,3 +26,5 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not etc_letsencrypt_mount_directory.stat.exists
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
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 }}
|
- name: Create etc-letsencrypt mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
||||||
@ -21,3 +26,5 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
when:
|
||||||
|
not etc_letsencrypt_mount_directory.stat.exists
|
||||||
|
Loading…
Reference in New Issue
Block a user