This repository was archived by the owner on Oct 4, 2023. It is now read-only.
File tree 3 files changed +23
-8
lines changed
3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ python: "2.7"
4
4
5
5
env :
6
6
- ANSIBLE_VERSION=1.9.4
7
+ - ANSIBLE_VERSION=2.1.3
7
8
- ANSIBLE_VERSION=latest
8
9
9
10
before_install :
Original file line number Diff line number Diff line change 19
19
- default/redis_sentinel.init.j2
20
20
paths :
21
21
- ../templates
22
- when : redis_as_service and ansible_service_mgr|default() != ' systemd'
22
+ when : redis_as_service and ansible_service_mgr|default() != " systemd"
23
23
24
24
- name : create sentinel systemd service
25
25
template :
32
32
- default/redis_sentinel.service.j2
33
33
paths :
34
34
- ../templates
35
- when : redis_as_service and ansible_service_mgr|default() == 'systemd'
35
+ register : sentinel_unit_file
36
+ when : redis_as_service and ansible_service_mgr|default() == "systemd"
36
37
37
38
- name : create systemd tmpfiles configuration
38
39
template :
41
42
mode : 0644
42
43
when :
43
44
- redis_as_service
44
- - ansible_service_mgr|default() == 'systemd'
45
- - (redis_sentinel_pidfile|dirname).startswith('/var/run') or (redis_sentinel_pidfile|dirname).startswith('/run')
45
+ - ansible_service_mgr|default() == "systemd"
46
+ - (redis_sentinel_pidfile|dirname).startswith("/var/run") or (redis_sentinel_pidfile|dirname).startswith("/run")
47
+
48
+ - name : reload systemd daemon
49
+ command : systemctl daemon-reload
50
+ when :
51
+ - redis_as_service
52
+ - ansible_service_mgr|default() == "systemd"
53
+ - sentinel_unit_file|changed
46
54
47
55
- name : set sentinel to start at boot
48
56
service :
49
57
name : sentinel_{{ redis_sentinel_port }}
50
58
enabled : yes
51
- daemon_reload : " {{ True if ansible_service_mgr|default() == 'systemd' else omit }}"
52
59
when : redis_as_service
53
60
54
61
# Check then create log dir to prevent aggressively overwriting permissions
Original file line number Diff line number Diff line change 19
19
- default/redis.init.j2
20
20
paths :
21
21
- ../templates
22
- when : redis_as_service and ansible_service_mgr|default() != ' systemd'
22
+ when : redis_as_service and ansible_service_mgr|default() != " systemd"
23
23
24
24
- name : create redis systemd service
25
25
template :
32
32
- default/redis.service.j2
33
33
paths :
34
34
- ../templates
35
- when : redis_as_service and ansible_service_mgr|default() == 'systemd'
35
+ register : redis_unit_file
36
+ when : redis_as_service and ansible_service_mgr|default() == "systemd"
36
37
37
38
- name : create systemd tmpfiles configuration
38
39
template :
44
45
- ansible_service_mgr|default() == 'systemd'
45
46
- (redis_pidfile|dirname).startswith('/var/run') or (redis_pidfile|dirname).startswith('/run')
46
47
48
+ - name : reload systemd daemon
49
+ command : systemctl daemon-reload
50
+ when :
51
+ - redis_as_service
52
+ - ansible_service_mgr|default() == "systemd"
53
+ - redis_unit_file|changed
54
+
47
55
- name : set redis to start at boot
48
56
service :
49
57
name : " {{ redis_service_name }}"
50
58
enabled : yes
51
- daemon_reload : " {{ True if ansible_service_mgr|default() == 'systemd' else omit }}"
52
59
when : redis_as_service
53
60
54
61
# Check then create log dir to prevent aggressively overwriting permissions
You can’t perform that action at this time.
0 commit comments