1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: "Create directory: /var/lib/rest-server"
file:
state: directory
path: /var/lib/rest-server
owner: "{{ services.rest_server.user }}"
group: "{{ services.rest_server.user }}"
notify: "Restart rest-server"
- name: "[OpenRC] Create service file"
template:
src: openrc-service.j2
dest: /etc/init.d/rest-server
mode: 0755
when:
- ansible_service_mgr == "openrc"
notify: "Restart rest-server"
- name: "[systemd] Create service file"
template:
src: systemd-service.j2
dest: /etc/systemd/system/rest-server.service
mode: 0755
when:
- ansible_service_mgr == "systemd"
notify: "Restart rest-server"