Bug 1564180

Summary: [3.7] Upgrade playbook fails with TemplateRuntimeError: no test named 'equalto'
Product: OpenShift Container Platform Reporter: Taneem Ibrahim <tibrahim>
Component: Cluster Version OperatorAssignee: Vadim Rutkovsky <vrutkovs>
Status: CLOSED ERRATA QA Contact: Mike Fiedler <mifiedle>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.7.0CC: aleks, aos-bugs, jokerman, mmccomas, smunilla, wmeng
Target Milestone: ---   
Target Release: 3.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
openshift-ansible-3.7.42-1.git.0.427f18c introduced a change which used a Jinja instructions that's only available in releases newer than those available in RHEL 7. This caused the upgrade playbook to fail with the error message "TemplateRuntimeError: no test named 'equalto'". The upgrade playbooks have been updated to only use Jinja instructions available in the versions that ship in RHEL 7 which ensures that the playbooks run as expected.
Story Points: ---
Clone Of:
: 1564182 (view as bug list) Environment:
Last Closed: 2018-04-05 23:48:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1564182    

Description Taneem Ibrahim 2018-04-05 14:57:55 UTC
Description of problem:

Version-Release number of the following components:
rpm -q openshift-ansible
>>> openshift-ansible-3.7.42-1.git.0.427f18c.el7.noarch
rpm -q ansible
>>> ansible-2.4.1.0-1.el7.noarch
ansible --version
>>> ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

How reproducible:

Always

Steps to Reproduce:
1. Upgrade the rpms to v3.7.42
2. ansible-playbook -i <ansible_hosts_file> /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_7/upgrade.yml

Actual results:

TASK [Upgrade master packages] ******************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TemplateRuntimeError: no test named 'equalto'
fatal: [master.ocp.io]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}
	to retry, use: --limit @/usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_7/upgrade.retry


Expected results:

Upgrade is successful

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Scott Dodson 2018-04-05 14:59:30 UTC
Fixed in https://github.com/openshift/openshift-ansible/pull/7747

Comment 2 Taneem Ibrahim 2018-04-05 15:05:23 UTC
-vvv output:

TASK [Upgrade master packages] ******************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/playbooks/common/openshift-cluster/upgrades/rpm_upgrade.yml:9
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 125, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 465, in _execute
    self._task.post_validate(templar=templar)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/task.py", line 249, in post_validate
    super(Task, self).post_validate(templar)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/base.py", line 376, in post_validate
    value = templar.template(getattr(self, name))
  File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 494, in template
    disable_lookups=disable_lookups,
  File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 450, in template
    disable_lookups=disable_lookups,
  File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 672, in do_template
    res = j2_concat(rf)
  File "<template>", line 10, in root
  File "/usr/lib/python2.7/site-packages/jinja2/filters.py", line 318, in do_join
    return text_type(d).join(imap(text_type, value))
  File "/usr/lib/python2.7/site-packages/jinja2/filters.py", line 931, in _select_or_reject
    if modfunc(func(transfunc(item))):
  File "/usr/lib/python2.7/site-packages/jinja2/filters.py", line 925, in <lambda>
    name, item, args, kwargs)
  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 438, in call_test
    raise TemplateRuntimeError('no test named %r' % name)
TemplateRuntimeError: no test named 'equalto'
fatal: [master.ocp.io]: FAILED! => {
    "failed": true,
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

Comment 4 Scott Dodson 2018-04-05 16:06:58 UTC
Reproducer:

1) Install 3.7
2) Run control plane and node upgrade playbooks from latest 3.7 GA versions, this should fail with the error above
3) Update your playbooks to the package referenced in comment 3, re-run, this should work

Comment 6 Mike Fiedler 2018-04-05 18:00:37 UTC
Reproduced the issue with: openshift-ansible-3.7.42-1.git.0.427f18c.el7.noarch

Verified upgrade runs successfully with:  openshift-ansible-3.7.42-1.git.2.9ee4e71.el7.noarch

Comment 10 errata-xmlrpc 2018-04-05 23:48:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0650

Comment 11 Scott Dodson 2018-04-18 16:08:58 UTC
*** Bug 1568783 has been marked as a duplicate of this bug. ***