# Setup module command line: permissions denied

**URL:** <https://forum.ansible.com/t/setup-module-command-line-permissions-denied/23537>\
**Category:** Ansible Project\
**Created:** [January 23, 2017, 7:18pm UTC](https://forum.ansible.com/t/setup-module-command-line-permissions-denied/23537 "2017-01-23T19:18:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Billie\_XU](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@Billie\_XU](https://forum.ansible.com/u/Billie_XU)\
**Post date:** [January 23, 2017, 7:18pm UTC](https://forum.ansible.com/t/setup-module-command-line-permissions-denied/23537/1 "2017-01-23T19:18:59Z")

</div>

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 😕

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

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [January 24, 2017, 10:49am UTC](https://forum.ansible.com/t/setup-module-command-line-permissions-denied/23537/2 "2017-01-24T10:49:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 24, 2017, 2:44pm UTC](https://forum.ansible.com/t/setup-module-command-line-permissions-denied/23537/3 "2017-01-24T14:44:31Z")

</div>

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.
