From d3e6ba137c2ba44736e7f140e5df2c6c3eea8840 Mon Sep 17 00:00:00 2001 From: Brett Meehan Date: Tue, 2 Feb 2021 10:14:22 +1100 Subject: [PATCH] ITPLAT-387 exclude bitbucket from catalina.out fix --- roles/product_install/tasks/main.yml | 3 ++- roles/product_startup/molecule/bitbucket/tests/test_default.py | 2 +- roles/product_startup/molecule/default/tests/test_default.py | 2 +- roles/product_startup/molecule/synchrony/tests/test_default.py | 2 +- roles/product_startup/templates/product.service.j2 | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 6051fdc..1e2fb65 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -265,13 +265,14 @@ state: link force: true -- name: "Ensure catalina.out log dir exists after product is installed" +- name: "Ensure catalina.out log dir exists after product is installed (except bitbucket)" file: path: "{{ atl_product_installation_current }}/logs" state: directory mode: 0750 owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" + when: atl_product_family != "stash" changed_when: false # For Molecule idempotence check - name: Include if jsd is requested to be installed from OBR diff --git a/roles/product_startup/molecule/bitbucket/tests/test_default.py b/roles/product_startup/molecule/bitbucket/tests/test_default.py index a8b6cf6..c895f75 100644 --- a/roles/product_startup/molecule/bitbucket/tests/test_default.py +++ b/roles/product_startup/molecule/bitbucket/tests/test_default.py @@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_service_file(host): systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib" f = host.file(systemd_prefix+'/systemd/system/bitbucket.service') - assert f.contains("^ExecStart=/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh -fg --no-search >/opt/atlassian/bitbucket/current/logs/catalina.out 2>/opt/atlassian/bitbucket/current/logs/catalina.err$") + assert f.contains("^ExecStart=/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh -fg --no-search$") assert f.contains("^UMask=0027$") assert f.contains("^LimitNOFILE=4096$") assert f.contains("^Environment=BITBUCKET_HOME=/media/atl/bitbucket$") diff --git a/roles/product_startup/molecule/default/tests/test_default.py b/roles/product_startup/molecule/default/tests/test_default.py index aadbb03..da1819b 100644 --- a/roles/product_startup/molecule/default/tests/test_default.py +++ b/roles/product_startup/molecule/default/tests/test_default.py @@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_service_file(host): systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib" f = host.file(systemd_prefix+'/systemd/system/jira-software.service') - assert f.contains("^ExecStart=/opt/atlassian/jira-software/current/bin/start-jira.sh -fg >/opt/atlassian/jira-software/current/logs/catalina.out 2>/opt/atlassian/jira-software/current/logs/catalina.err$") + assert f.contains("^ExecStart=/opt/atlassian/jira-software/current/bin/start-jira.sh -fg >/opt/atlassian/jira-software/current/logs/catalina.out 2>&1$") assert f.user == 'root' assert f.group == 'root' assert f.mode == 0o0640 diff --git a/roles/product_startup/molecule/synchrony/tests/test_default.py b/roles/product_startup/molecule/synchrony/tests/test_default.py index f6217d6..52a98fb 100644 --- a/roles/product_startup/molecule/synchrony/tests/test_default.py +++ b/roles/product_startup/molecule/synchrony/tests/test_default.py @@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_service_file(host): systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib" f = host.file(systemd_prefix+'/systemd/system/synchrony.service') - assert f.contains("^ExecStart=/opt/atlassian/bin/start-synchrony >/opt/atlassian/confluence/current/logs/catalina.out 2>/opt/atlassian/confluence/current/logs/catalina.err$") + assert f.contains("^ExecStart=/opt/atlassian/bin/start-synchrony >/opt/atlassian/confluence/current/logs/catalina.out 2>&1$") assert f.contains("^EnvironmentFile=/etc/atl$") assert f.contains("^EnvironmentFile=/etc/atl.synchrony$") assert f.contains("^WorkingDirectory=/opt/atlassian/confluence/current/logs/$") diff --git a/roles/product_startup/templates/product.service.j2 b/roles/product_startup/templates/product.service.j2 index 2d1235d..fd1e620 100644 --- a/roles/product_startup/templates/product.service.j2 +++ b/roles/product_startup/templates/product.service.j2 @@ -12,7 +12,7 @@ StandardError=journal+console {{ p }} {% endfor %} -ExecStart={{ atl_startup_exec_path }}{% for c in atl_startup_exec_options %} {{ c }}{% endfor %} >{{ atl_product_installation_current }}/logs/catalina.out 2>{{ atl_product_installation_current }}/logs/catalina.err +ExecStart={{ atl_startup_exec_path }}{% for c in atl_startup_exec_options %} {{ c }}{% endfor %}{% if (atl_product_family != "stash") %} >{{ atl_product_installation_current }}/logs/catalina.out 2>&1{% endif %} Restart=on-failure