Fix pacemaker_running boolean

In legacy deployments this caused the resource agents to fail being
installed because the role was trying to install it on non-pacemaker
nodes.

Change-Id: Ic841ead2132abfff4ce4c6d739d1afd0cca11ee5
Closes-Bug: #1748196
This commit is contained in:
Juan Antonio Osorio Robles 2018-02-08 15:45:44 +02:00
parent e2ca161336
commit 7815cc5108
3 changed files with 6 additions and 6 deletions

View File

@ -105,7 +105,7 @@
- include_tasks: resource-agent.yml
when:
- pacemaker_running
- pacemaker_running|bool
- type != 'opportunistic'
- current_vip.ip != ''
- inventory_hostname == groups['pacemaker'][0]
@ -154,7 +154,7 @@
- include_tasks: resource-agent.yml
when:
- pacemaker_running
- pacemaker_running|bool
- type != 'opportunistic'
- redis_in_subnet|bool
- inventory_hostname == groups['pacemaker'][0]

View File

@ -43,7 +43,7 @@
mode: '0755'
force: no
register: resource_agent
when: pacemaker_running
when: pacemaker_running|bool
- include_tasks: ipsec-conf.yml
with_items: "{{ private_networks }}"

View File

@ -34,7 +34,7 @@
- name: Determine which node is hosting the VIP
shell: pcs status | grep ip- | sed 's/ip-//' | awk '{print $1"\t"$4}' | grep "{{ networks[0]['vips'][0]['ip'] }}" | awk '{print $2}'
register: node_hosting_the_vip
when: pacemaker_running
when: pacemaker_running|bool
- name: Add uniqueids = no to ipsec setup configuration
lineinfile:
@ -56,7 +56,7 @@
mode: '0755'
force: no
register: resource_agent
when: pacemaker_running
when: pacemaker_running|bool
# This queries the VIPs for all networks and flattens them into a list
# that contains a dict with the "name" and "ip" for each VIP entry.
@ -65,5 +65,5 @@
loop_var: current_vip
with_items: "{{ networks|default([])|json_query('[*].vips[]')|list }}"
when:
- pacemaker_running|bool
- node_hosting_the_vip.stdout == ansible_hostname
- pacemaker_running