How to install ansible.posix without Internet but with some RHEL repositories locally available

I want to use ansible.posix in my Ansible scripts. The simple

ansible-galaxy collection install ansible.posix

does not work, because the network (with control node and managed nodes) is not connected to the Internet.

How can I install a collection via files transferred from another machine?

I don’t really understand what you’re trying to do. Isn’t ansible.posix included within Ansible out-of-the-box?

Installing collections — Ansible Community Documentation describes how to download a collection tarball from Ansible Galaxy, and the same page has multiple examples of how to install a collection from a tarball.

@mcen1 ansible.posix is part of the Ansible community distribution, ansible · PyPI. But there are multiple things called “Ansible”, so they might only use ansible-core directly, which does not come with ansible.posix.

3 Likes

You can install a collection from a file, see 3rd example Installing collections — Ansible Community Documentation

1 Like

To elaborate on @felixfontein’s info: I am using RHEL9 repos (only thing we have offline access to) and I was able to install ansible-core from there but no posix stuff.

Thanks for the link. Explains it well.