From 7815cc5108cdb3748ff1f9651e46c52fa5065940 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Thu, 8 Feb 2018 15:45:44 +0200 Subject: [PATCH] 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 --- tasks/ipsec-conf.yml | 4 ++-- tasks/ipsec.yml | 2 +- tasks/legacy.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/ipsec-conf.yml b/tasks/ipsec-conf.yml index 960af5f..cea5231 100644 --- a/tasks/ipsec-conf.yml +++ b/tasks/ipsec-conf.yml @@ -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] diff --git a/tasks/ipsec.yml b/tasks/ipsec.yml index 1b9438f..5ffecbd 100644 --- a/tasks/ipsec.yml +++ b/tasks/ipsec.yml @@ -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 }}" diff --git a/tasks/legacy.yml b/tasks/legacy.yml index 783f423..423850f 100644 --- a/tasks/legacy.yml +++ b/tasks/legacy.yml @@ -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