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

ansible collection for the client side of things #461

Open
bendem opened this issue Nov 22, 2022 · 14 comments
Open

ansible collection for the client side of things #461

bendem opened this issue Nov 22, 2022 · 14 comments
Labels
packaging Related to the packaging

Comments

@bendem
Copy link
Contributor

bendem commented Nov 22, 2022

What is the idea ?

Following the spirit of #71, it would be nice to install the callback and ansible modules using collections rather than through pip.

Currently, I have this is my ansible config to make the callback plugin useable, would love to clean it up:

[defaults]
; non portable, only works when launched from our bundled container
callback_plugins = /venv/lib/python3.8/site-packages/ara/plugins/callback

I'm currently using 1.5.8.

@dmsimard
Copy link
Contributor

Hi @bendem and thanks for the issue.

I agree that it's challenging to keep track of where the callback is installed depending on the distro, venv, etc.
It's why we came up with helper modules like python3 -m ara.setup.callback_plugins but it's not something you can put in an ansible.cfg because it's just an ini file.

We dicussed whether we should do this a while back here:

At a high level, we've decided to keep the ansible plugins in the ara package because installing it takes care of the dependencies and lets us keep the simple "getting started" workflow:

  • pip install ara[server]
  • export ANSIBLE_CALLBACK_PLUGINS=$(python3 -m ara.setup.callback_plugins)
  • Running a playbook as usual

If the callback is in the collection, there are several gotchas and additional steps required.

ara-collection has historically been about setting up an ara server but there could probably be a role that takes care of setting up the client side as well. That doesn't mean moving the callback to the collection, though.

Let me know if you have ideas but in the meantime I hope that makes sense.

@dmsimard dmsimard added the packaging Related to the packaging label Nov 22, 2022
@amilcarlucas
Copy link

ansible-lint complains that "ara_record" is not a FQCN .
is there a way to use a real FQCN without installing ara via collections?

@dmsimard
Copy link
Contributor

dmsimard commented Dec 1, 2022

@amilcarlucas that's a good question, I'm not sure.

While I realize it isn't ideal, I suppose a workaround would be to configure ansible-lint ignore that particular lint rule for the time being.

@bendem
Copy link
Contributor Author

bendem commented Dec 8, 2022

Yes, that's what we've done for now, but as you said, it's not ideal since it's a global setting and hides other valid problems.

@bendem
Copy link
Contributor Author

bendem commented Dec 8, 2022

For what it's worth, we have the same problem with hashivault (TerryHowe/ansible-modules-hashivault#234 (comment))

@flowerysong
Copy link
Contributor

The FQCN is ansible.legacy.ara_record, but it's a pretty useless linting rule so there's not really any danger to disabling it.

@dmsimard
Copy link
Contributor

dmsimard commented Dec 9, 2022

Oh, thanks @flowerysong, indeed I was told about ansible.legacy when I asked about it in the ansible-lint channel and I forgot to follow up here.

@hille721
Copy link
Contributor

ansible-lint complains that "ara_record" is not a FQCN .

In my case ansible-lint is not complaining about FQCN but printing a warning when using ara_playbook

WARNING  Unable to load module ara_playbook at playbooks/tests/test_ara_demo.yml:9 for options validation
WARNING  Unable to resolve FQCN for module ara_playbook

Wouldn't it be easy to write a proper Ansible collection for the ara plugins which simple wraps around the PyPI package?

@hille721
Copy link
Contributor

Also no syntax highlighting, autocomplete or documentation on hover for the ara modules when using Ansible extension in VSCode

@bendem
Copy link
Contributor Author

bendem commented Mar 15, 2023

In my case ansible-lint is not complaining about FQCN but printing a warning when using ara_playbook

Did you try specifying ansible.legacy.ara_playbook as suggested?

@hille721
Copy link
Contributor

Did you try specifying ansible.legacy.ara_playbook as suggested?

As I said, I don't have a problem regarding the FQCN, I just get those warnings. If I use ansible.legacy.ara_playbook it changes nothing except the warning is now

WARNING  Unable to load module ansible.legacy.ara_playbook at tests/test_ara_demo.yml:9 for options validation
WARNING  Unable to resolve FQCN for module ansible.legacy.ara_playbook

@bendem
Copy link
Contributor Author

bendem commented Mar 15, 2023

arf, fun times.

@Hipska
Copy link

Hipska commented Jan 28, 2025

As a new user to ARA, I was also confused about the way to install and use the callback. IMHO having it as a collection (which wraps the PyPi package as @hille721 suggested) would make much sense.

@hille721
Copy link
Contributor

hille721 commented Jan 29, 2025

@Hipska in fact I already discussed this with @dmsimard and @Thulium-Drake last year and already opened a WIP PR: ansible-community/ara-collection#75
Unfortunately I did not had the time to further drive it to get it merged.
But basically it works, already using that approach for a while now.

Edit:
link to issue in ara-collection with the discussion: ansible-community/ara-collection#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Related to the packaging
Projects
None yet
Development

No branches or pull requests

6 participants