From 697051c9be4423af53491c3faeb146667bbebb25 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 27 May 2019 12:39:50 +1000 Subject: [PATCH] DCD-352: Make the name of the shared home dir configurable by product. --- group_vars/aws_node_local.yml | 6 +++++- .../molecule/default/tests/test_default.py | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index a69c57c..26930eb 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -17,7 +17,11 @@ atl_shared_mountpoint: "/media/atl" # FIXME: Some of these should be overridden from the environment? atl_home_base: "/var/atlassian/application-data" atl_product_home: "{{ atl_home_base }}/{{ atl_product_family }}" -atl_product_home_shared: "{{ atl_shared_mountpoint }}/{{ atl_product_family }}/shared" +atl_product_shared_home_map: + confluence: "shared-home" + jira: "shared" + stash: "FIXME" +atl_product_home_shared: "{{ atl_shared_mountpoint }}/{{ atl_product_family }}/{{ atl_product_shared_home_map[atl_product_family] }}" atl_product_shared_plugins: "{{ atl_product_home_shared }}/plugins/installed-plugins" atl_installation_base: "/opt/atlassian" diff --git a/roles/confluence_config/molecule/default/tests/test_default.py b/roles/confluence_config/molecule/default/tests/test_default.py index 9a939d0..f6dfb2f 100644 --- a/roles/confluence_config/molecule/default/tests/test_default.py +++ b/roles/confluence_config/molecule/default/tests/test_default.py @@ -1,4 +1,5 @@ import os +import pytest import testinfra.utils.ansible_runner @@ -42,6 +43,16 @@ def test_install_permissions(host): assert host.file('/opt/atlassian/confluence/current/work/').user == 'confluence' assert host.file('/opt/atlassian/confluence/current/temp/').user == 'confluence' +@pytest.mark.parametrize('directory', [ + '/var/atlassian/application-data/confluence/', + '/media/atl/confluence/shared-home/' +]) +def test_home_directories(host, directory): + d = host.file(directory) + assert d.exists + assert d.user == 'confluence' + + # def test_dbconfig_file(host): # f = host.file('/var/atlassian/application-data/jira/dbconfig.xml') # assert f.exists