Backwards compatible Ansible Collection support in project?

Greetings Ansible Community,

I am a user/customer, contributor and recently a collaborator of https://github.com/confluentinc/cp-ansible.

This project has proven extremely valuable in provisioning large and complex Kafka clusters. But already since the start, I have been annoyed by the only supported usage pattern, which is described here: https://docs.confluent.io/ansible/current/ansible-download.html.

This way of using cp-ansible does not fit us for several reasons, but mostly because we have other components in our Kafka infrastructure that we want to provision from the same Ansible setup. The workaround so far, has been to use the pesky Git Submodules. After being fed up with that, I filed this cp-ansible issue: https://github.com/confluentinc/cp-ansible/issues/613.

I have done some of the mandatory (and simple) changes. The work so far is summarized in this mega feature PR: https://github.com/confluentinc/cp-ansible/pull/630.

But now I have started looking into the probably most complex issue: plugins. Our ultimate goal is: Support using cp-ansible as an Ansible Collection, but still support the existing usage pattern (git clone ). Is this possible? I have created a draft PR, but currently it just contains two molecule test scenarios proving that I/we have work to do: https://github.com/confluentinc/cp-ansible/pull/631

Does anyone on this mailing list have some hints/tips? I tried to ask on IRC, but just got one negative answer: “Not possible”

Any help would be greatly appreciated!

Regards,
Erik

Hi,

I am still struggeling to make this work, and the lack of comments to this question tells me that it might not be possible at all? I would appreciate if someone with in-depth knowledge of Ansible could confirm this - so I can avoid wasting more time on this issue.

Since my original question, I have done some more testing, and it seems like the plugins is the (only) blocker. So close, but no sigar…

  • To use the project as a collection, all plugins must be referred to by their FQN.
  • When cloning the project (existing usage pattern), the plugins are not found - since the new collection plugin location is not taken into consideration. I have tried symlinking to fix the location issue, but since plugins has to be referred to by their FQN this does not work either.

I think it would be nice if Ansible could support a gradual migration from legacy usage patterns to collection, and not the “big bang” I am now experiencing.

Erik

lørdag 3. april 2021 kl. 22:51:09 UTC+2 skrev Erik Godding Boye:

afaik there is nothing preventing the old usage pattern, collections
introduce a new way of doing things, they do not eliminate any
existing way.

As for giving a migration path to a every custom workflow, I don't
think this is a scalable request.

As for the plugin issue, there should be examples for migrating roles
that will handle the fqcn vs non fqcn referencing and module_utils
imports in the works.

Thanks for your feedback! I am not asking for a “migration path to every custom workflow”. I just would like to see some support tools to facilitate the migration from a typically legacy Ansible project setup, to the modern collection layout - which I think provides far better organization and metadata description.

Are you able to provide some links or references to “examples for migrating roles that will handle the fqcn vs non fqcn referencing and module_utils imports”, even in WIP state? That sounds interesting!

Erik