From e0a634bf5d1492ff45a8f8c2c214c6e8a40b5962 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 5 May 2020 12:54:05 +0200 Subject: [PATCH] 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 --- deployment/nova/nova-compute-container-puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index 0393762d57..3335ad1535 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -1018,7 +1018,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]}