Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action plugin in collection not loaded if collection keyword in task not defined #65071

Closed
ganeshrn opened this issue Nov 19, 2019 · 4 comments · Fixed by #65849
Closed

action plugin in collection not loaded if collection keyword in task not defined #65071

ganeshrn opened this issue Nov 19, 2019 · 4 comments · Fixed by #65849
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. collection Related to Ansible Collections work networking Network category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ganeshrn
Copy link
Member

ganeshrn commented Nov 19, 2019

SUMMARY

If action plugin with the same name is present in collection and ansible core and if collections keyword is not defined in the paly the action plugin from the core is loaded instead of action plugin in collection

Works fine if collection keyword defined in the play eg:
PB1: https://gist.github.com/ganeshrn/7a7426aec0317277b16be1d9f5c83aed

Fails if collection keyword not defined in play eg:
PB2: https://gist.github.com/ganeshrn/3a2fabb690e29ceb00c02180666d1c83

Collection structure:
https://github.com/ganeshrn/network_collections_migration/tree/master/collections/ansible_collections/arista/eos

Value of collection_list at line for
PB1:

['arista.eos', 'ansible.legacy']

PB2:

[]
ISSUE TYPE
  • Bug Report
COMPONENT NAME

lib/ansible/executor/task_executor.py (might be)

ANSIBLE VERSION
$ansible --version
ansible 2.10.0.dev0
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE

https://gist.github.com/ganeshrn/3a2fabb690e29ceb00c02180666d1c83

EXPECTED RESULTS

Should load action plugin from the collection itself even if the collection keyword not defined and the task name is FQCN.

ACTUAL RESULTS

@ganeshrn ganeshrn changed the title action plugin in collection not loaded if collection keyword in task not given action plugin in collection not loaded if collection keyword in task not defined Nov 19, 2019
@ansibot
Copy link
Contributor

ansibot commented Nov 19, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 19, 2019
@samdoran samdoran added collection Related to Ansible Collections work networking Network category and removed needs_triage Needs a first human triage before being processed. labels Dec 3, 2019
@samdoran
Copy link
Contributor

samdoran commented Dec 3, 2019

cc @nitzmahone

@samdoran samdoran added the has_pr This issue has an associated PR. label Dec 3, 2019
@samdoran
Copy link
Contributor

samdoran commented Dec 3, 2019

Fixed by #65078

@ganeshrn
Copy link
Member Author

ganeshrn commented Dec 4, 2019

@samdoran @nitzmahone The PR you referred for this issue does not fix this issue. PR #65078 is specific to network code flow and it is added to allow scenario wherein the network connection plugins is moved to a collection.

This issue is different, not specific to network and seems to be in the generic collection code path. I have shared the reproducer in the issue description.

@ganeshrn ganeshrn added needs_triage Needs a first human triage before being processed. and removed has_pr This issue has an associated PR. labels Dec 4, 2019
@Qalthos Qalthos removed the needs_triage Needs a first human triage before being processed. label Dec 5, 2019
ganeshrn added a commit to ganeshrn/ansible that referenced this issue Dec 15, 2019
Fixes ansible#65071

*  Load network action plugin that matches the module
   prefix name from list of collections.
ganeshrn added a commit that referenced this issue Dec 16, 2019
* Fix network action plugin load in collection

Fixes #65071

*  Load network action plugin that matches the module
   prefix name from list of collections.

* Update changelog

* Fix unit test
ganeshrn added a commit to ganeshrn/ansible that referenced this issue Dec 16, 2019
* Fix network action plugin load in collection

Fixes ansible#65071

*  Load network action plugin that matches the module
   prefix name from list of collections.

* Update changelog

* Fix unit test

(cherry picked from commit 74e9b1e)
mattclay pushed a commit that referenced this issue Jan 11, 2020
* Fix network action plugin load in collection

Fixes #65071

*  Load network action plugin that matches the module
   prefix name from list of collections.

* Update changelog

* Fix unit test

(cherry picked from commit 74e9b1e)
@ansible ansible locked and limited conversation to collaborators Jan 13, 2020
ruozeng-w pushed a commit to ruozeng-w/ansible that referenced this issue Apr 18, 2020
* Fix network action plugin load in collection

Fixes ansible#65071

*  Load network action plugin that matches the module
   prefix name from list of collections.

* Update changelog

* Fix unit test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. collection Related to Ansible Collections work networking Network category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants