mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 17:03:06 -06:00
DCD-802: Fix test and implementation for setting shared home owner and
group to application user
This commit is contained in:
@@ -4,7 +4,58 @@
|
||||
vars:
|
||||
atl_backup_manifest_url: 's3://dcd-slingshot-test/dummy_manifest.json'
|
||||
atl_product_user: 'jira'
|
||||
atl_product_user_uid: '2001'
|
||||
atl_backup_home_restore_canary_path: '/tmp/canary.tmp'
|
||||
atl_product_home_shared: '/media/atl/jira/shared'
|
||||
atl_backup_id: 'test-backup'
|
||||
atl_backup_home_dest: "{{ test_archive }}"
|
||||
|
||||
roles:
|
||||
- restore_backups
|
||||
test_archive_source: '/tmp/hello'
|
||||
test_archive_file: 'hello.txt'
|
||||
test_archive: '/tmp/hello.tar.gz'
|
||||
test_pre_step_prefix: '[PRE-TEST]'
|
||||
|
||||
pre_tasks:
|
||||
- name: "{{ test_pre_step_prefix }} Install tar"
|
||||
package:
|
||||
state: present
|
||||
name: tar
|
||||
|
||||
- name: "{{ test_pre_step_prefix }} Install useradd and groupadd binaries"
|
||||
package:
|
||||
state: present
|
||||
name: shadow-utils
|
||||
|
||||
- name: "{{ test_pre_step_prefix }} Create application group"
|
||||
group:
|
||||
name: "{{ atl_product_user }}"
|
||||
gid: "{{ atl_product_user_uid }}"
|
||||
|
||||
- name: "{{ test_pre_step_prefix }} Create application user"
|
||||
user:
|
||||
name: "{{ atl_product_user }}"
|
||||
uid: "{{ atl_product_user_uid }}"
|
||||
group: "{{ atl_product_user }}"
|
||||
|
||||
- block:
|
||||
- name: "{{ test_pre_step_prefix }} Create a directory for the shared home archive"
|
||||
file:
|
||||
path: "{{ test_archive_source }}"
|
||||
state: directory
|
||||
- name: "{{ test_pre_step_prefix }} Create a file in the shared home"
|
||||
lineinfile:
|
||||
create: yes
|
||||
line: 'Hello, world!'
|
||||
path: "{{ test_archive_source }}/{{ test_archive_file }}"
|
||||
- name: "{{ test_pre_step_prefix }} Archive the shared home"
|
||||
archive:
|
||||
path: "{{ test_archive_source }}"
|
||||
dest: "{{ test_archive }}"
|
||||
owner: "{{ atl_product_user }}"
|
||||
|
||||
tasks:
|
||||
- name: Install distro-specific restore support packages
|
||||
include_tasks: "../../tasks/{{ ansible_distribution|lower }}.yml"
|
||||
|
||||
- name: Restore shared home
|
||||
include_tasks: "../../tasks/home_restore.yml"
|
||||
|
||||
Reference in New Issue
Block a user