DCD-352: Make the service-file installation generic across products.

This commit is contained in:
Steve Smith
2019-05-27 14:28:26 +10:00
parent 92b71f63f8
commit 069c99ce8c
8 changed files with 30 additions and 20 deletions

View File

@@ -16,3 +16,4 @@
- role: product_install
- role: database_init
- role: confluence_config
- role: product_startup

View File

@@ -16,4 +16,4 @@
- role: product_install
- role: database_init
- role: jira_config
- role: jira_startup
- role: product_startup

View File

@@ -1,7 +0,0 @@
---
- name: Restart Jira
service: name=jira.service state=restarted
- name: Enable Jira
command: systemctl enable jira.service

View File

@@ -1,10 +0,0 @@
---
- name: Install Jira service file
template:
src: jira.service.j2
dest: /etc/systemd/system/jira.service
notify:
- Enable Jira
- Restart Jira

View 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"

View 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 }}"

View 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

View File

@@ -1,12 +1,12 @@
[Unit]
Description=Atlassian Jira
Description=Atlassian {{ atl_product_edition }}
After=network-online.target
[Service]
User={{ atl_product_user }}
Group={{ atl_product_user }}
ExecStart={{ atl_product_installation_current }}/bin/start-jira.sh -fg
ExecStart={{ atl_product_installation_current }}/bin/{{ atl_startup_script_map[atl_product_family] }} -fg
Restart=on-failure
[Install]