File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 55 enabled : yes
66 with_items :
77 - corosync
8- - pacemaker
9- - pacemaker-remote
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+ {% if inventory_hostname in groups [pacemaker_corosync_group ] %}
2+ {% set _pacemaker_corosync_bind_addr = hostvars [inventory_hostname ]['ansible_eth1' | replace ('-' , '_' )].ipv 4.address %}
3+ {% else %}
4+ {% set _pacemaker_corosync_bind_addr = hostvars [inventory_hostname ]['ansible_' + pacemaker_corosync_ring_interface | replace ('-' , '_' )].ipv 4.address %}
5+ {% endif %}
6+
27totem {
38 version: 2
49 cluster_name: {{ pacemaker_corosync_group }}
@@ -28,16 +33,21 @@ quorum {
2833
2934{% if pacemaker_enable_nodelist |default (true ) %}
3035nodelist {
31- {% for node in groups [pacemaker_corosync_group ]|sort %}
36+
37+ {% for node in groups [pacemaker_remote_group ]|sort + groups [pacemaker_corosync_group ]|sort %}
38+ {% if node in groups [pacemaker_corosync_group ] %}
39+ {% set _tmp_pacemaker_corosync_ring_interface = 'eth1' %}
40+ {% else %}
41+ {% set _tmp_pacemaker_corosync_ring_interface = pacemaker_corosync_ring_interface %}
42+ {% endif %}
3243 node {
33- ring0_addr: {{ hostvars[node] ['ansible_' + pacemaker_corosync_ring_interface | replace('-', '_')] .ipv4.address }}
44+ ring0_addr: {{ hostvars[node] ['ansible_' + _tmp_pacemaker_corosync_ring_interface | replace('-', '_')] .ipv4.address }}
3445 name: {{ pacemaker_corosync_fqdn | bool | ternary(hostvars[node] .ansible_fqdn, node) }}
3546 nodeid: {{ loop.index }}
3647 }
3748{% endfor %}
38- }
3949{% endif %}
40-
50+ }
4151logging {
4252 to_logfile: {{ (pacemaker_corosync_use_logfile | bool) | ternary('yes', 'no') }}
4353 {% if pacemaker_corosync_use_logfile | bool %}
You can’t perform that action at this time.
0 commit comments