ITPLAT-387 move logdir creation to somewhere that doesnt break tests and mod the service test

This commit is contained in:
Brett Meehan
2020-12-31 12:20:09 +11:00
parent 75c905fe7d
commit d270cb75cb
3 changed files with 2 additions and 10 deletions

View File

@@ -132,6 +132,7 @@
- "{{ atl_product_installation_versioned }}" - "{{ atl_product_installation_versioned }}"
- "{{ atl_product_version_cache_dir }}" - "{{ atl_product_version_cache_dir }}"
- "{{ atl_product_home_shared_download_dir }}" - "{{ atl_product_home_shared_download_dir }}"
- "{{ atl_product_installation_current }}/logs"
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
# At this point atl_product_version should be set, cache if necessary. # At this point atl_product_version should be set, cache if necessary.

View File

@@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_service_file(host): def test_service_file(host):
systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib" systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib"
f = host.file(systemd_prefix+'/systemd/system/jira-software.service') f = host.file(systemd_prefix+'/systemd/system/jira-software.service')
assert f.contains("^ExecStart=/opt/atlassian/jira-software/current/bin/start-jira.sh -fg$") 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.user == 'root' assert f.user == 'root'
assert f.group == 'root' assert f.group == 'root'
assert f.mode == 0o0640 assert f.mode == 0o0640

View File

@@ -1,13 +1,4 @@
--- ---
- name: "Ensure startup log dir exists"
file:
path: "{{ atl_product_installation_current }}/logs"
state: directory
mode: 0750
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
changed_when: false # For Molecule idempotence check
- name: "Install systemd service file" - name: "Install systemd service file"
template: template:
src: "product.service.j2" src: "product.service.j2"