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 5
5
enabled : yes
6
6
with_items :
7
7
- 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
+
2
7
totem {
3
8
version: 2
4
9
cluster_name: {{ pacemaker_corosync_group }}
@@ -28,16 +33,21 @@ quorum {
28
33
29
34
{% if pacemaker_enable_nodelist |default (true ) %}
30
35
nodelist {
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 %}
32
43
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 }}
34
45
name: {{ pacemaker_corosync_fqdn | bool | ternary(hostvars[node] .ansible_fqdn, node) }}
35
46
nodeid: {{ loop.index }}
36
47
}
37
48
{% endfor %}
38
- }
39
49
{% endif %}
40
-
50
+ }
41
51
logging {
42
52
to_logfile: {{ (pacemaker_corosync_use_logfile | bool) | ternary('yes', 'no') }}
43
53
{% if pacemaker_corosync_use_logfile | bool %}
You can’t perform that action at this time.
0 commit comments