Fix IHA with ansible 2.9
With ansible 2.9 IHA breaks like this:
TASK [If instance HA is enabled on the node activate the evacuation completed check] ***
Tuesday 05 May 2020 08:36:49 +0000 (0:00:00.403) 0:15:33.184 ***********
fatal: [compute-0]: FAILED! => {"msg": "The conditional check 'iha_nodes.stdout|lower | search('\"'+ansible_hostname|lower+'\"')'
failed. The error was: template error while templating string: no filter named 'search'. String: {% if iha_nodes.stdout|lower |
search('\"'+ansible_hostname|lower+'\"') %} True {% else %} False {% endif %}\n\nThe error appears to be in
'/var/lib/mistral/overcloud/ComputeInstanceHA/host_prep_tasks.yaml': line 391, column 5, but may\nbe elsewhere in the file depending
on the exact syntax problem.\n\nThe offending line appears to be:\n\n register: iha_nodes\n - file:
path=/var/lib/nova/instanceha/enabled state=touch\n ^ here\n"}
This is because in ansible 2.9 changed the way filters work.
We need to use the 'is' keyword just like we do in a number of other
places in tripleo-ansible.
Change-Id: Ie2c348df46519765d43330523e15d1861ed9a7b4
Closes-Bug: #1876897
(cherry picked from commit e0a634bf5d
)
This commit is contained in:
parent
908280a058
commit
91dbf71ebb
|
@ -960,7 +960,7 @@ outputs:
|
|||
register: iha_nodes
|
||||
- name: If instance HA is enabled on the node activate the evacuation completed check
|
||||
file: path=/var/lib/nova/instanceha/enabled state=touch
|
||||
when: iha_nodes.stdout|lower | search('"'+ansible_hostname|lower+'"')
|
||||
when: iha_nodes.stdout|lower is search('"'+ansible_hostname|lower+'"')
|
||||
- name: is KSM enabled
|
||||
set_fact:
|
||||
compute_ksm_enabled: {get_attr: [RoleParametersValue, value, compute_enable_ksm]}
|
||||
|
|
Loading…
Reference in New Issue