Merged in DCD-791-symlink-conf-attachments (pull request #51)

DCD-791: Force attachments into shared home

Approved-by: Geoff Jacobs <gjacobs@atlassian.com>
Approved-by: Adam Brokes <abrokes@atlassian.com>
This commit is contained in:
Steve Smith
2019-11-27 01:12:28 +00:00
2 changed files with 28 additions and 0 deletions

View File

@@ -16,6 +16,16 @@ def test_conf_init_file(host):
assert f.exists
assert f.contains('confluence.home = /var/atlassian/application-data/confluence')
def test_conf_attachment_symlinks(host):
assert host.file('/var/atlassian/application-data/confluence').is_directory
assert host.file('/media/atl/confluence/shared-home/attachments/').is_directory
f = host.file('/var/atlassian/application-data/confluence/attachments')
assert f.is_symlink and f.linked_to == '/media/atl/confluence/shared-home/attachments'
f = host.file('/var/atlassian/application-data/confluence/shared-home')
assert f.is_symlink and f.linked_to == '/media/atl/confluence/shared-home'
def test_setenv_file(host):
f = host.file('/opt/atlassian/confluence/current/bin/setenv.sh')
assert f.exists

View File

@@ -10,9 +10,27 @@
with_items:
- "{{ atl_product_home }}"
- "{{ atl_product_home_shared }}"
- "{{ atl_product_home_shared }}/attachments"
- "{{ atl_product_shared_plugins }}"
changed_when: false # For Molecule idempotence check
# Create symlink to force single (unclustered) Confluence to store
# shared-data and attachments in the shared drive.
- name: Symlink local attachments to shared storage
file:
src: "{{ item.0 }}"
dest: "{{ item.1 }}"
force: false
state: link
mode: 0750
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
vars:
- links:
- ["{{ atl_product_home_shared }}/", "{{ atl_product_home }}/shared-home"]
- ["{{ atl_product_home_shared }}/attachments/", "{{ atl_product_home }}/attachments"]
with_nested:
- "{{ links }}"
- name: Create Tomcat server config
template: