Replace "failed" and "succeeded" filters for assertions

In Ansible 2.9 these filters are no longer available, so lets replace
them for assertions.

Change-Id: Ied08114b1e70b116740eafa59c8491fd4374e712
This commit is contained in:
Juan Antonio Osorio Robles 2020-01-23 14:33:17 +02:00
parent ffe104c743
commit 0c8693cecc
1 changed files with 7 additions and 7 deletions

View File

@ -18,36 +18,36 @@
command: pcs resource show {{ resource_agent_name }}
ignore_errors: yes
register: found_resource_agent
changed_when: found_resource_agent|failed
changed_when: found_resource_agent is failed
- name: Delete {{ resource_agent_name }} Resource Agent
command: pcs resource delete {{ resource_agent_name }}
when:
- resource_agent.changed
- found_resource_agent|succeeded
- found_resource_agent is succeeded
- name: Add {{ resource_agent_name }} pacemaker resource agent
command: pcs resource create {{ resource_agent_name }} ocf:heartbeat:ipsec tunnel={{ specific_tunnel }} vip={{ specific_vip }}
fallbacktunnel={{ fallback_tunnel }} --disabled
when:
- resource_agent.changed or found_resource_agent|failed
- resource_agent.changed or found_resource_agent is failed
- name: Add collocation rule with VIP ( {{ resource_agent_name }} )
command: pcs constraint colocation add {{ resource_agent_name }} with ip-{{ specific_vip }}
when:
- resource_agent.changed or found_resource_agent|failed
- resource_agent.changed or found_resource_agent is failed
- name: Add ordering rule with VIP ( {{ resource_agent_name }} ) for start operation
command: pcs constraint order start ip-{{ specific_vip }} then start {{ resource_agent_name }} symmetrical=false
when:
- resource_agent.changed or found_resource_agent|failed
- resource_agent.changed or found_resource_agent is failed
- name: Add ordering rule with VIP ( {{ resource_agent_name }} ) for stop operation
command: pcs constraint order stop ip-{{ specific_vip }} then stop {{ resource_agent_name }} symmetrical=false
when:
- resource_agent.changed or found_resource_agent|failed
- resource_agent.changed or found_resource_agent is failed
- name: Enable {{ resource_agent_name }} resource agent
command: pcs resource enable {{ resource_agent_name }}
when:
- resource_agent.changed or found_resource_agent|failed
- resource_agent.changed or found_resource_agent is failed