Bug 2207872

Summary: upgrade from 4.x to 5.3 is failing with conditional check 'cephadm_mgmt_network is ansible.utils.ipv4'
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vinayak Papnoi <vpapnoi>
Component: Ceph-AnsibleAssignee: Teoman ONAY <tonay>
Status: CLOSED ERRATA QA Contact: Vinayak Papnoi <vpapnoi>
Severity: urgent Docs Contact: Akash Raj <akraj>
Priority: urgent    
Version: 5.3CC: akraj, bhull, ceph-eng-bugs, cephqe-warriors, crwayman, fpantano, gabrioux, gjose, gmeno, gsitlani, kdreyer, lithomas, tonay, trchakra, tserlin, vereddy
Target Milestone: ---Keywords: Regression, UpgradeBlocker
Target Release: 5.3z4   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ceph-ansible-6.0.28.4-2.el8cp ansible-collection-ansible-utils-2.3.0-2.el8cp Doc Type: Bug Fix
Doc Text:
.Dependency to `ansible-collection-ansible` is created when deploying `ceph-ansible` Previously, for the `cephadm-adopt.yml` playbook, an additional ansible library (`ansible-utils`) was used to work with _ipv4_ and _ipv6_ mixed environments. As `ansible-utils` is not deployed by default, there were missing dependencies. With this fix, a dependency to `ansible-collection-ansible` is created when deploying `ceph-ansible` and `cephadm-adopt.yml` playbook completes successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-19 16:19:11 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: 2190412, 2210690    

Description Vinayak Papnoi 2023-05-17 07:48:43 UTC
Description of problem:

While upgrading the system from 4.x to 5.3, getting the error as mentioned below:

2023-05-16 11:34:52,524 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'TASK [manage nodes with cephadm - ipv4] ****************************************'
2023-05-16 11:34:52,524 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'task path: /usr/share/ceph-ansible/infrastructure-playbooks/cephadm-adopt.yml:371'
2023-05-16 11:34:52,525 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'Tuesday 16 May 2023  11:34:52 -0400 (0:00:01.234)       0:01:09.062 *********** '
2023-05-16 11:34:52,595 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'fatal: [ceph-vpapnoi-up-bz-7p5s6b-node1-installer -> {{ groups[mon_group_name][0] }}]: FAILED! => '
2023-05-16 11:34:52,597 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  msg: |-'
2023-05-16 11:34:52,598 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b"    The conditional check 'cephadm_mgmt_network is ansible.utils.ipv4' failed. The error was: template error while templating string: no test named 'ansible.utils.ipv4'. String: {% if cephadm_mgmt_network is ansible.utils.ipv4 %} True {% else %} False {% endif %}"
2023-05-16 11:34:52,599 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  '
2023-05-16 11:34:52,600 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b"    The error appears to be in '/usr/share/ceph-ansible/infrastructure-playbooks/cephadm-adopt.yml': line 371, column 7, but may"
2023-05-16 11:34:52,600 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'    be elsewhere in the file depending on the exact syntax problem.'
2023-05-16 11:34:52,601 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  '
2023-05-16 11:34:52,602 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'    The offending line appears to be:'
2023-05-16 11:34:52,603 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  '
2023-05-16 11:34:52,603 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  '
2023-05-16 11:34:52,604 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'        - name: manage nodes with cephadm - ipv4'
2023-05-16 11:34:52,605 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'          ^ here'
2023-05-16 11:34:52,618 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'fatal: [ceph-vpapnoi-up-bz-7p5s6b-node2 -> {{ groups[mon_group_name][0] }}]: FAILED! => '
2023-05-16 11:34:52,619 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b'  msg: |-'
2023-05-16 11:34:52,620 (cephci.test_ansible_upgrade) [DEBUG] - cephci.ceph.py:1520 - b"    The conditional check 'cephadm_mgmt_network is ansible.utils.ipv4' failed. The error was: template error while templating string: no test named 'ansible.utils.ipv4'. String: {% if cephadm_mgmt_network is ansible.utils.ipv4 %} True {% else %} False {% endif %}"



Version-Release number of selected component (if applicable):

# rpm -qa | grep ansible
ceph-ansible-6.0.28.4-1.el8cp.noarch
ansible-2.9.27-1.el8ae.noarch
# rpm -qa | grep cephadm
cephadm-16.2.10-172.el8cp.noarch


How reproducible:

3/3

Steps to Reproduce:
1. Perform upgrade from 4.x to 5.3 (build mentioned above)
2.
3.

Actual results:

Getting an error as mentioned in the description:
The conditional check 'cephadm_mgmt_network is ansible.utils.ipv4' failed. The error was: template error while templating string: no test named 'ansible.utils.ipv4'. String: {% if cephadm_mgmt_network is ansible.utils.ipv4 %} True {% else %} False {% endif %}"


Expected results:
Upgrade should be successful without any errors.


Additional info:

Comment 30 errata-xmlrpc 2023-07-19 16:19:11 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 (Red Hat Ceph Storage 5.3 Bug Fix update), 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-2023:4213