mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -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_backup_home_restore_canary_path: '/tmp/canary.tmp'
|
||||
|
||||
tasks:
|
||||
- name: Install distro-specific restore support packages
|
||||
include_tasks: "../../tasks/{{ ansible_distribution|lower }}.yml"
|
||||
roles:
|
||||
- restore_backups
|
||||
|
||||
@@ -18,3 +18,9 @@ def test_postgresql_amazon_linux_extras_exes(host, exe):
|
||||
def test_postgresql_version(host):
|
||||
pg_dump_version_output = host.check_output('pg_dump --version')
|
||||
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:
|
||||
src: "{{ atl_backup_home_dest }}"
|
||||
dest: "{{ atl_product_home_shared }}"
|
||||
owner: "{{ atl_product_user }}"
|
||||
group: "{{ atl_product_user }}"
|
||||
become: "{{ atl_product_user }}"
|
||||
|
||||
- name: Create restore-canary if necessary
|
||||
copy:
|
||||
|
||||
Reference in New Issue
Block a user