How do i install an ansible galaxy role from a tar.gz file as non-root user ?

356 views
Skip to first unread message

Hans Lammerts

unread,
Aug 15, 2020, 8:56:11 AM8/15/20
to Ansible Project
Hi,

I have seen a number of sites that explain how to install a role from a tar.gz file using ansible-galaxy, and they all seem to say the same thing.
In my case I have downloaded the following role file from ansible galaxy :
dsglaser-cis_security-1.2.0.tar.gz

Then I tried to install
ansible-galaxy collection install dsglaser-cis_security-1.2.0.tar.gz

which gives me the warning :

[WARNING]: - collection was NOT installed successfully: Failed to get data from the API server (https://galaxy.ansible.com/api/): Failed to connect to galaxy.ansible.com at port 443: [Errno 104] Connection reset by peer

This is correct, because this machine is not, and never will be connected to the internet.

Another attempt :

ansible-galaxy install dsglaser-cis_security-1.2.0.tar.gz


results in another warning:
[WARNING]: - dsglaser-cis_security-1.2.0.tar.gz was NOT installed successfully: the specified roles path exists and is not a directory.

Also tried using the -p option to indicate where I want the role to be installed, with and without the directory present, but every attempt resulted in the last warning.

I'm **not** doing this as root...
Ansible version is 2.8.13

Just discovered that the command

ansible-galaxy install dsglaser-cis_security-1.2.0.tar.gz -p ./bla

does work, but only as root. And that's not what I want...

What am I doing wrong ?
 

Luca 'remix_tj' Lorenzetto

unread,
Aug 17, 2020, 3:25:43 AM8/17/20
to ansible...@googlegroups.com
On Sat, Aug 15, 2020 at 2:56 PM Hans Lammerts <j.lam...@chello.nl> wrote:
> Just discovered that the command
>
> ansible-galaxy install dsglaser-cis_security-1.2.0.tar.gz -p ./bla
>
> does work, but only as root. And that's not what I want...
>
> What am I doing wrong ?

It's very strange, maybe ./bla directory is root owned?

You should be able to run this command without being root.

Luca


--
"E' assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca 'remix_tj' Lorenzetto, http://www.remixtj.net , <lorenze...@gmail.com>
Reply all
Reply to author
Forward
0 new messages