mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 08:53:07 -06:00
DCD-802: become product user when unarchiving shared home. Implement
test that shared home is owned by correct user
This commit is contained in:
@@ -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"
|
|
||||||
|
|||||||
@@ -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'
|
||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user