DCD-802: Fix test and implementation for setting shared home owner and

group to application user
This commit is contained in:
Ben Partridge
2019-11-18 16:37:26 +11:00
parent 41cd616a60
commit 4827ae8423
4 changed files with 101 additions and 34 deletions

View File

@@ -0,0 +1,37 @@
---
- name: Check for the restore canary file
stat:
path: "{{ atl_backup_home_restore_canary_path }}"
register: restore_canary
- block:
- name: Create shared home if necessary
file:
path: "{{ atl_product_home_shared }}"
state: directory
mode: 0750
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
- name: Restore the shared-home backup
unarchive:
src: "{{ atl_backup_home_dest }}"
remote_src: yes
dest: "{{ atl_product_home_shared }}"
mode: 0640
- name: Set shared home file owner to application user
file:
path: "{{ atl_product_home_shared }}"
recurse: yes
group: "{{ atl_product_user }}"
state: directory
mode: 0640
owner: "{{ atl_product_user }}"
- name: Create restore-canary if necessary
copy:
dest: "{{ atl_backup_home_restore_canary_path }}"
content: "{{ atl_backup_id }}"
when: not restore_canary.stat.exists