DCD-802: become product user when unarchiving shared home. Implement

test that shared home is owned by correct user
This commit is contained in:
Ben Partridge
2019-11-13 17:31:06 +11:00
parent e85b906019
commit b1643eccee
3 changed files with 9 additions and 5 deletions

View File

@@ -6,6 +6,5 @@
atl_product_user: 'jira' atl_product_user: 'jira'
atl_backup_home_restore_canary_path: '/tmp/canary.tmp' atl_backup_home_restore_canary_path: '/tmp/canary.tmp'
tasks: roles:
- name: Install distro-specific restore support packages - restore_backups
include_tasks: "../../tasks/{{ ansible_distribution|lower }}.yml"

View File

@@ -18,3 +18,9 @@ def test_postgresql_amazon_linux_extras_exes(host, exe):
def test_postgresql_version(host): def test_postgresql_version(host):
pg_dump_version_output = host.check_output('pg_dump --version') pg_dump_version_output = host.check_output('pg_dump --version')
assert '(PostgreSQL) 9.6' in pg_dump_version_output assert '(PostgreSQL) 9.6' in pg_dump_version_output
def test_shared_home_owner(host):
for root, dirs, files in os.walk('/media/atl/jira/shared'):
for fileName in files + dirs:
assert host.file(fileName).user == 'jira'
assert host.file(fileName).group == 'jira'

View File

@@ -124,8 +124,7 @@
unarchive: unarchive:
src: "{{ atl_backup_home_dest }}" src: "{{ atl_backup_home_dest }}"
dest: "{{ atl_product_home_shared }}" dest: "{{ atl_product_home_shared }}"
owner: "{{ atl_product_user }}" become: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
- name: Create restore-canary if necessary - name: Create restore-canary if necessary
copy: copy: