Bug 2090264 - [DR] Failed to generate mapping files due to import ansible module that was not found
Summary: [DR] Failed to generate mapping files due to import ansible module that was n...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.5.0.8
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.5.1
: ---
Assignee: Pavel Bar
QA Contact: sshmulev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-25 12:53 UTC by sshmulev
Modified: 2022-06-23 05:54 UTC (History)
5 users (show)

Fixed In Version: ovirt-ansible-collection-2.1.0-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-23 05:54:58 UTC
oVirt Team: Storage
Embargoed:
pm-rhel: ovirt-4.5?
lsvaty: blocker-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-collection pull 503 0 None Merged Fix "'ansible' ModuleNotFoundError" in Disaster Recovery scripts 2022-06-16 07:54:58 UTC
Red Hat Issue Tracker RHV-46118 0 None None None 2022-05-25 12:55:37 UTC

Description sshmulev 2022-05-25 12:53:00 UTC
Description of problem:
Failed to generate the mapping file for DR flow(active-passive) on the ovirt-engine as the master site.
# ./ovirt-dr generate
Traceback (most recent call last):
  File "./ovirt-dr", line 15, in <module>
    import fail_back
  File "/usr/share/ansible/collections/ansible_collections/redhat/rhv/roles/disaster_recovery/files/fail_back.py", line 14, in <module>
    from ansible.module_utils.six.moves import input
ModuleNotFoundError: No module named 'ansible'


Version-Release number of selected component (if applicable):
ovirt-engine-4.5.0.7-0.9.el8ev.noarch
ansible-core-2.12.2-3.1.el8.x86_64

# rpm -qa | grep ansible
ansible-core-2.12.2-3.1.el8.x86_64
python38-ansible-runner-2.1.3-1.el8ev.noarch
ansible-collection-ansible-utils-2.3.0-2.2.el8ev.noarch
ansible-collection-ansible-posix-1.3.0-1.2.el8ev.noarch
ansible-runner-2.1.3-1.el8ev.noarch
ansible-collection-ansible-netcommon-2.2.0-3.2.el8ev.noarch
ovirt-ansible-collection-2.0.3-1.el8ev.noarch


How reproducible:
100%

Steps to Reproduce:
1. Go to /usr/share/ansible/collections/ansible_collections/ovirt/ovirt/roles/disaster_recovery/files/
2. After setting the dr.conf file to the DR's environment information, generate the mapping file: "./ovirt-dr generate"


Actual results:
The file is not generated due to import failure in fail_back.py line 14: ModuleNotFoundError: No module named 'ansible'

Expected results:
The script should succeed to generate the mapping file mapping_vars.yml without any errors


Additional info:
Worked in ovirt-engine 4.4

Comment 1 sshmulev 2022-05-25 13:00:21 UTC
As a workaround to generate the mapping file I installed the missing package by "pip3 install ansible" and then the generate worked.

Comment 4 sshmulev 2022-06-19 13:13:17 UTC
Verified.

# ./ovirt-dr generate
Log file: '/tmp/ovirt-dr-1655644080939.log'
[WARNING]: provided hosts list is empty, only localhost is available. Note that

the implicit localhost does not match 'all'

[WARNING]: running playbook inside collection redhat.rhv

[Generate Mapping File] Finished generating variable mapping file for oVirt ansible disaster recovery.
Log file: '/tmp/ovirt-dr-1655644080939.log'


Versions:
ansible-core-2.12.2-3.1.el8.x86_64
engine-4.5.1.2-0.11.el8ev
vdsm-4.50.1.3-1.el8ev

Comment 5 Sandro Bonazzola 2022-06-23 05:54:58 UTC
This bugzilla is included in oVirt 4.5.1 release, published on June 22nd 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.1 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.