debops / debops/debops

[ansible_plugins] Handling is broken with collections support

Open
#1,320 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: high tag: Ansible Collection
Dominant language
Jinja
Stars
1.4k
Forks
379
Avg merge
4d 18h
Merged PRs (30d)
8

Description

Hey @all,

we are currently using debops via git submodule integration and would like to keep it that way. This broke for us with the recent changes to support ansible collections. As for now we were able to distinguish between our roles and the debops roles by setting the roles_path accordingly and referencing them via their folder names.

I found that, I could setup a structure simulating a fake collection like that:

ansible.cfg
extern
     |
     - ansible-debops (git  submodule ansible-debops.git)
     - collections
         |
         -  ansible_collections
                |
                - debops
                       |
                       - debobs (link to ../../../ansible-debops/ansible/)

If I set collections_paths in ansible.cfg to ./extern/collections, I just have to rename the role imports in our playbooks to use the FQCN (debops.python => debops.debops.python).

This works for all roles but debops.ansible_pluginsand all the debops_contrib.* roles.


The offending line appears to be:
ERROR! the role 'debops.debops.debops-contrib.apparmor' was not found in ...
- import_role:
    name: debops.debops.debops-contrib.apparmor
          ^ here

I suggest to rename debops.ansible_plugins to ansible_plugins or to remove it completely and relay on plugins directory on collections level.

If you like release contrib roles in a different collection please separat them into a different directory or name them collections compliant like contrib_*.

Of course I could write a shell script linking all roles to their corresponding debops.* names and continue with the include via roles_path. But I do not like this solution :).

Any help or ideas are appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the collection layout described in ansible.cfg, including the linked ansible-debops directory and ansible_collections tree. Compare handling of ansible_plugins and debops_contrib roles with the roles that already work through FQCN imports. Done means these roles work with the git-submodule collection setup without requiring generated links or a roles_path workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, git
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.