-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
converge.yml
58 lines (56 loc) · 2.24 KB
/
converge.yml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: Converge
hosts: all
become: true
gather_facts: true
vars:
_service_test_command:
default: /usr/bin/sleep
Alpine: /bin/sleep
Debian: /bin/sleep
Ubuntu-16: /bin/sleep
Ubuntu-18: /bin/sleep
service_test_command: "{{ _service_test_command[ansible_distribution ~ '-' ~ ansible_distribution_major_version] | default(_service_test_command[ansible_os_family] | default(_service_test_command['default'])) }}" # noqa 204 Just long.
roles:
- role: ansible-role-service
service_list:
- name: simple-service
description: Simple Service
start_command: "{{ service_test_command }} 3600"
state: started
enabled: true
- name: stopped-service
description: Simple Service
start_command: "{{ service_test_command }} 3601"
state: stopped
enabled: false
- name: specific-stop-service
description: Specific Stop Service
start_command: "{{ service_test_command }} 1440"
stop_command: /usr/bin/killall -f "sleep 1440"
- name: specific-user-group-service
description: Specific User Group Service
start_command: "{{ service_test_command }} 28800"
user_name: root
group_name: root
- name: specific-workingdirectory-service
description: Specific WorkingDirectory Service
start_command: "{{ service_test_command }} 57600"
working_directory: /tmp
- name: specific-pattern-service
description: Specific Status Pattern Service
start_command: "{{ service_test_command }} 115200"
status_pattern: 115200
- name: variable-service
description: Service with environment variables
start_command: "{{ service_test_command }} ${time}"
environment_variables:
time: 230400
- name: pidfile-service
description: Service with pidfile
start_command: "{{ service_test_command }} 460800"
pidfile: /var/run/pidfile-service.pid
- name: environmentfile-service
description: Service with environmentfile
start_command: "{{ service_test_command }} 921600"
environmentfile: /environmentfile.txt