Description of problem: Ansible caching ovirt-ansible-modules so sometimes they are not loaded from role's library For example: When user will use role/module for managing hosts (ovirt-hosts module or ovirt-infra role) it take the module from: /usr/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ovirt_hosts.py after in the same playbook when user will use role with this module included in library folder (/usr/share/ansible/roles/ovirt-cluster-upgrade/library/ovirt_hosts.py), the module in library will be ignored because this module is already cached. Version-Release number of selected component (if applicable): ansible-2.3.1.0-3.el7.noarch ovirt-ansible-roles-1.0.1-1.el7ev.noarch How reproducible: Always Steps to Reproduce: 1. run infra role and host upgrade role in same playbook Actual results: affected all modules in library folders (user can run ansible module before role)
Can you add extra information on which modules are being used for what roles (Galaxy/included in RPM) and specific use-case where this is a problem?
Introduction: - Ansible uses modules merged in version 2.3.1.0-3 location of these modules: [1] /usr/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ in the ansible package - When user use oVirt Ansible module Ansible will take the module from [1]. Roles may have own modules specified in their folder called library example location: [2] /usr/share/ansible/roles/ovirt-cluster-upgrade/library/ from ovirt-ansible rpm - so for example in ovirt-cluster-upgrade role we have in [2] modules ( ovirt_clusters.py ovirt_hosts.py... and others) which is different than in [1] (fixed some bugs in modules until they will be merged into Ansible) The problem is: When user will use: - oVirt Ansible role which doesn't have fixed modules in library folder and then he will use oVirt Ansible role that have fixed modules in library folder => second role will use some modules from [1] (first role will use modules A,B,C second role needs modules A,C,D specified in library folder so second role now will use A,C from [1] and D from [2]) - users own created playbook that use some oVirt Ansible modules from Ansible and then he run oVirt Ansible role => ansible will cache modules from [1] and the next role will use cached modules (same as before) - directly oVirt Ansible module and after that he will use oVirt Ansible role => every module used before will be cached and after it will be ignored in oVirt Ansible role Conclusion: using older module from [1] (directly or in any role) before oVirt Ansible role which has these modules fixed in library folder [2] may result into different and unpredictable behavior worst scenario: ignored all modules in all library folders [2] (all modules are cached from [1]) - affected RPM and Galaxy as well. example problem (there are many cases): - using module ovirt_hosts (directly or in ovirt-infra role...etc), have a host in maintenance, upgrade hosts with status [Maintenance] ([Maintenance, UP]..) via role ovirt-cluster-upgrade - role will freeze on maintenance hosts => ovirt-cluster-upgrade should use module ovirt_hosts.py from [2] but it will use module from [1])
Closing as the issue is in Ansible itself and it will most probably be fixed once Ansible as a platform will switch to ansible-collections