mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
DCD-1089: The systemd installation location depends on the OS.
This commit is contained in:
@@ -14,6 +14,11 @@ atl_startup_exec_path: "{{ atl_product_installation_current }}/{{ atl_startup_sc
|
||||
atl_startup_exec_options: ["-fg"]
|
||||
atl_startup_systemd_params: []
|
||||
|
||||
atl_systemd_service_dir_map:
|
||||
amazon: "/usr/lib/systemd/system"
|
||||
ubuntu: "/lib/systemd/system"
|
||||
atl_systemd_service_dir: "{{ atl_systemd_service_dir_map[ansible_distribution|lower] }}"
|
||||
|
||||
atl_systemd_service_name: "{{ atl_product_edition }}.service"
|
||||
|
||||
atl_systemd_service_target: "multi-user.target"
|
||||
|
||||
@@ -29,8 +29,11 @@
|
||||
pre_tasks:
|
||||
- name: Create systemd dir if necessary
|
||||
file:
|
||||
path: '/usr/lib/systemd/system/'
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- '/usr/lib/systemd/system/'
|
||||
- '/lib/systemd/system/'
|
||||
|
||||
roles:
|
||||
- role: product_startup
|
||||
|
||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
|
||||
|
||||
def test_service_file(host):
|
||||
f = host.file('/usr/lib/systemd/system/bitbucket.service')
|
||||
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$")
|
||||
assert f.contains("^UMask=0027$")
|
||||
assert f.contains("^LimitNOFILE=4096$")
|
||||
|
||||
@@ -12,8 +12,11 @@
|
||||
pre_tasks:
|
||||
- name: Create systemd dir if necessary
|
||||
file:
|
||||
path: '/usr/lib/systemd/system/'
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- '/usr/lib/systemd/system/'
|
||||
- '/lib/systemd/system/'
|
||||
|
||||
roles:
|
||||
- role: product_startup
|
||||
|
||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
|
||||
|
||||
def test_service_file(host):
|
||||
f = host.file('/usr/lib/systemd/system/jira-software.service')
|
||||
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$")
|
||||
assert f.user == 'root'
|
||||
assert f.group == 'root'
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
pre_tasks:
|
||||
- name: Create systemd dir if necessary
|
||||
file:
|
||||
path: '/usr/lib/systemd/system/'
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- '/usr/lib/systemd/system/'
|
||||
- '/lib/systemd/system/'
|
||||
|
||||
roles:
|
||||
- role: product_startup
|
||||
|
||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
|
||||
|
||||
def test_service_file(host):
|
||||
f = host.file('/usr/lib/systemd/system/synchrony.service')
|
||||
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$")
|
||||
assert f.contains("^EnvironmentFile=/etc/atl$")
|
||||
assert f.contains("^EnvironmentFile=/etc/atl.synchrony$")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- name: "Install systemd service file"
|
||||
template:
|
||||
src: "product.service.j2"
|
||||
dest: "/usr/lib/systemd/system/{{ atl_systemd_service_name }}"
|
||||
dest: "{{ atl_systemd_service_dir }}/{{ atl_systemd_service_name }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0640
|
||||
|
||||
Reference in New Issue
Block a user