Setup module command line: permissions denied

Hi all,

I need to get a list of available facts from one of my machines. I can run playbook against it (ssh keys and password-less access already setup) but for some reason when I run the following command it complains permission denied:
`

ansible master -i hosts -m setup
`

master only has one host IP address

hosts is the default inventory file

I have used

ansible master -m setup

as suggested by many posts but got the warning: no hosts matched, nothing to do :confused:

I honestly don’t know what’s wrong.

If anyone can solve the problem, could you please let me know how do you normally print out all available facts in a playbook? I dont know which ones are available thats why I want to print out all of them.

Thank you all very much.

Cheers,
Billie

This line does not tell ansible to use sudo to get elevated rights, so
it is run as the normal user ansible logs in with.

Try to add "-b" (if you dont require a sudo password) or "-b -K" to
your command.

Although I do not know why setup would require root, it does not on my
machines.

Johannes

Billie Xu,
Please supply the full error output ‘permission denied’ can be many things.

FYI, setup does not require root, but if you are root you may get access to more facts, depending on your OS, distro and configuration.