mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
DCD-352: Make the service-file installation generic across products.
This commit is contained in:
8
roles/product_startup/defaults/main.yml
Normal file
8
roles/product_startup/defaults/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
atl_startup_script_map:
|
||||
jira: "start-jira.sh"
|
||||
confluence: "start-confluence.sh"
|
||||
stash: "start-bitbucket.sh"
|
||||
|
||||
atl_systemd_service_name: "{{ atl_product_edition }}.service"
|
||||
9
roles/product_startup/handlers/main.yml
Normal file
9
roles/product_startup/handlers/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
|
||||
- name: Restart Product
|
||||
service:
|
||||
name: "{{ atl_systemd_service_name }}"
|
||||
stat: restarted
|
||||
|
||||
- name: Enable Jira
|
||||
command: systemctl enable "{{ atl_systemd_service_name }}"
|
||||
9
roles/product_startup/tasks/main.yml
Normal file
9
roles/product_startup/tasks/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
|
||||
- name: "Install systemd service file"
|
||||
template:
|
||||
src: "product.service.j2"
|
||||
dest: "/etc/systemd/system/{{ atl_systemd_service_name }}"
|
||||
notify:
|
||||
- Enable Product
|
||||
- Restart Product
|
||||
13
roles/product_startup/templates/product.service.j2
Normal file
13
roles/product_startup/templates/product.service.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Atlassian {{ atl_product_edition }}
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User={{ atl_product_user }}
|
||||
Group={{ atl_product_user }}
|
||||
|
||||
ExecStart={{ atl_product_installation_current }}/bin/{{ atl_startup_script_map[atl_product_family] }} -fg
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-target.target
|
||||
Reference in New Issue
Block a user