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 11pacemaker_corosync_fqdn : false
22pacemaker_corosync_group : false
33pacemaker_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 7979 owner : root
8080 notify : Restart corosync
8181
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+
8288- name : Adds logrotate config for corosync
8389 template :
8490 src : corosync_logrotate.conf.j2
8591 dest : /etc/logrotate.d/corosync
8692 mode : " 0644"
8793 owner : root
94+ when : pacemaker_corosync_use_logfile | bool is true
8895
8996- name : Creates services directory
9097 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 %}
12totem {
23 version: 2
34 cluster_name: {{ pacemaker_corosync_group }}
67{% endif %}
78 interface {
89 ringnumber: 0
9- bindnetaddr: {{ hostvars[inventory_hostnam e] ['ansible_' + pacemaker_corosync_ring_interface | replace('-', '_' )] .ipv4.address }}
10+ bindnetaddr: {{ _pacemaker_corosync_bind_addr }}
1011 broadcast: yes
1112 mcastport: 5405
1213 }
@@ -29,7 +30,7 @@ quorum {
2930nodelist {
3031{% for node in groups [pacemaker_corosync_group ]|sort %}
3132 node {
32- ring0_addr: {{ hostvars[nod e] ['ansible_' + pacemaker_corosync_ring_interfac e] .ipv4.address }}
33+ ring0_addr: {{ _pacemaker_corosync_bind_addr }}
3334 name: {{ pacemaker_corosync_fqdn | bool | ternary(hostvars[node] .ansible_fqdn, node) }}
3435 nodeid: {{ loop.index }}
3536 }
@@ -38,9 +39,10 @@ nodelist {
3839{% endif %}
3940
4041logging {
41- to_logfile: yes
42+ to_logfile: {{ (pacemaker_corosync_use_logfile | bool) | ternary('yes', 'no') }}
43+ {% if pacemaker_corosync_use_logfile | bool %}
4244 logfile: /var/log/corosync/corosync.log
43- to_syslog: yes
45+ {% endif %}
46+ to_syslog: {{ (pacemaker_corosync_use_syslog | bool) | ternary('yes', 'no') }}
4447 timestamp: on
4548}
46-
You can’t perform that action at this time.
0 commit comments