File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
pacemaker_corosync_fqdn : false
2
2
pacemaker_corosync_group : false
3
3
pacemaker_corosync_ring_interface : false
4
+ pacemaker_corosync_use_syslog : true
5
+ pacemaker_corosync_use_logfile : false
Original file line number Diff line number Diff line change 79
79
owner : root
80
80
notify : Restart corosync
81
81
82
+ - name : Creates log directory
83
+ file :
84
+ path : /var/log/corosync
85
+ state : directory
86
+ when : pacemaker_corosync_use_logfile | bool is true
87
+
82
88
- name : Adds logrotate config for corosync
83
89
template :
84
90
src : corosync_logrotate.conf.j2
85
91
dest : /etc/logrotate.d/corosync
86
92
mode : " 0644"
87
93
owner : root
94
+ when : pacemaker_corosync_use_logfile | bool is true
88
95
89
96
- name : Creates services directory
90
97
file :
Original file line number Diff line number Diff line change
1
+ {% set _pacemaker_corosync_bind_addr = hostvars [inventory_hostname ]['ansible_' + pacemaker_corosync_ring_interface | replace ('-' , '_' )].ipv 4.address %}
1
2
totem {
2
3
version: 2
3
4
cluster_name: {{ pacemaker_corosync_group }}
6
7
{% endif %}
7
8
interface {
8
9
ringnumber: 0
9
- bindnetaddr: {{ hostvars[inventory_hostnam e] ['ansible_' + pacemaker_corosync_ring_interface | replace('-', '_' )] .ipv4.address }}
10
+ bindnetaddr: {{ _pacemaker_corosync_bind_addr }}
10
11
broadcast: yes
11
12
mcastport: 5405
12
13
}
@@ -29,7 +30,7 @@ quorum {
29
30
nodelist {
30
31
{% for node in groups [pacemaker_corosync_group ]|sort %}
31
32
node {
32
- ring0_addr: {{ hostvars[nod e] ['ansible_' + pacemaker_corosync_ring_interfac e] .ipv4.address }}
33
+ ring0_addr: {{ _pacemaker_corosync_bind_addr }}
33
34
name: {{ pacemaker_corosync_fqdn | bool | ternary(hostvars[node] .ansible_fqdn, node) }}
34
35
nodeid: {{ loop.index }}
35
36
}
@@ -38,9 +39,10 @@ nodelist {
38
39
{% endif %}
39
40
40
41
logging {
41
- to_logfile: yes
42
+ to_logfile: {{ (pacemaker_corosync_use_logfile | bool) | ternary('yes', 'no') }}
43
+ {% if pacemaker_corosync_use_logfile | bool %}
42
44
logfile: /var/log/corosync/corosync.log
43
- to_syslog: yes
45
+ {% endif %}
46
+ to_syslog: {{ (pacemaker_corosync_use_syslog | bool) | ternary('yes', 'no') }}
44
47
timestamp: on
45
48
}
46
-
You can’t perform that action at this time.
0 commit comments