How can I make ansible-galaxy work if it is not connected to internet?
Thank you
ansible-galaxy role install linux-system-roles.network
[WARNING]: - linux-system-roles. network was NOT installed successfully: Unknown error when attempting to call
Galaxy at ‘https://galaxy.ansible.com/api/’: <urlopen error [Errno 101] Network is unreachable>
How do you expect to download a role from the internet if you don’t have access to the internet in the first place. An offline flag would only work if you’ve already downloaded the roles and placed it somewhere, if that’s the case then just copy it into the roles directory like normal roles.
You can also do as the previous commenter said and mirror the content to a local repository and target that server when installing roles.
By mirror I mean cloning, downloading content from ansible-galaxy and placing it into a server in your network.
This server can then expose the very same content via http/s, git protocols.
So you’ll need to come up with an strategy to fetch content upstream to your network.
After you’ve built your catalog of ansible items internally, you could instruct ansible-galaxy to fetch it from your internal network instead.
This concept of air-gapped/disconnected networks applies for multiple approaches, like distributing RPMs, container images and so on.
in rhel-system-roles package the geerlinguy or haproxy role is not there. How will I use a geerlinguy haproxy role?
I don't know, but I'm curious as to why you thought the "geerlinguy haproxy" role was provided by the linux-system-roles or rhel-system-roles RPM package?
You seem to be circling around the fact that you don’t have internet connectivity in your environment.
And the recommendations that were given by the previous posters didn’t get any traction.
There are many ways to get content onto an air gapped system.
But this is entirely dependent on your environment.
If all else fails, just download the content on an internet connected host and copy it to your ansible host. Perhaps by USB stick, whatever works for you.
If you don’t know how to do that, then ask someone who DOES know your environment (your sysadmin or tech support or whatever).