Bug 1774096

Summary: network role broken with Ansible Engine 2.9 due to missing python-jmespath
Product: Red Hat Enterprise Linux 7 Reporter: Pavel Cahyna <pcahyna>
Component: rhel-system-rolesAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: David Jež <djez>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.7CC: bperkins, djez, jpoulin, vcrhonek, vdolezal
Target Milestone: rcKeywords: Extras
Target Release: 7.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhel-system-roles-1.0-10.el7_7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-04 19:27:07 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: 1774150    
Bug Blocks:    

Description Pavel Cahyna 2019-11-19 14:40:18 UTC
Description of problem:

Ansible Engine 2.9 repos for RHEL 7 do not include the python-jmespath package anymore, needed by the json_query filter. This filter is used in the network role (and will be used elsewhere), so the network role now fails.

How reproducible:
easily when using official Ansible Engine 2.9 to run system roles

Steps to Reproduce:
run network role tests (tests_default.yml against localhost is enough)

Actual results:
FAILED! => {"msg": "The conditional check 'not
network_packages is subset(ansible_facts.packages.keys())' failed. The
error was: An unhandled exception occurred while templating '{{
_network_provider_setup[network_provider]['packages'] }}'.
Error was a <class 'ansible.errors.AnsibleError'>,
original message: An unhandled exception occurred while templating
'{u'initscripts': {u'service_name': u'{{
network_service_name_default_initscripts }}', u'packages': u'{{
network_packages_default_initscripts }}'}, u'nm': {u'service_name':
u'{{ network_service_name_default_nm }}', u'packages': u'{{
network_packages_default_nm }}'}}'.
Error was a <class 'ansible.errors.AnsibleError'>,
original message: An unhandled exception occurred while templating '{{
['ethtool'] + _network_packages_default_initscripts_bridge|select()|list()
+ _network_packages_default_initscripts_network_scripts|select()|list()
}}'.
Error was a <class 'ansible.errors.AnsibleError'>,
original message: An unhandled exception occurred while templating
'[u\"{% if ['bridge'] in network_connections|json_query('[*][type]')
and ( (ansible_distribution in ['RedHat', 'CentOS'] and
ansible_distribution_major_version is version('7', '<=')) or
(ansible_distribution == 'Fedora' and
ansible_distribution_major_version is version('28', '<=')) )
%}bridge-utils{% endif %}\"]'.
Error was a <class 'ansible.errors.AnsibleError'>, original message:
You need to install \"jmespath\" prior to running json_query
filter\n\n
The error appears to be in
'/usr/share/ansible/roles/rhel-system-roles.network/tasks/main.yml':
line 20, column 3, but may\nbe elsewhere in the file depending on the
exact syntax problem.\n\n
The offending line appears to be:\n\n# Therefore install packages only
when rpm does not find them\n- name: Install packages\n  ^ here\n"}

Expected results:
tests should succeed

Additional info:

Similar problem occured in RHEL 8 when python-jmespath was removed from AE repositories for RHEL 8 and was solved by adding python-jmespath as a dependency of rhel-system-roles (bz1660559). The same approach will need to be taken here. Note that the package will need to be re-added - it was added in bz1489592 for a similar reason, as a dependency of Ansible then, see bz1484910 - but was deprecated with the rest of Ansible and its dependecies, bz1533106, and readding it to composes requires a new Maitai process.

Comment 4 errata-xmlrpc 2020-02-04 19:27:07 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/RHEA-2020:0407