# How to run ansible cli in awx

**URL:** <https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 5, 2020, 5:39pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395 "2020-03-05T17:39:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francois\_Nature](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@Francois\_Nature](https://forum.ansible.com/u/Francois_Nature)\
**Post date:** [March 5, 2020, 5:39pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/1 "2020-03-05T17:39:48Z")

</div>

Hi,  
I don’t seem to find the answer anywhere,  
I've just started to deploy and use ansible AWX. There are lots of tutos on ansible CLI. So when I run in the awx\_task container for example  
ansible-inventory --graph  
it doesn't list the inventories and hosts I defined in ansible AWX.  
So is the only solution to use tower-cli to interact with AWX ? I can't do any local cli on the server with ansible directly ... ?  
Many thanks

---

<div class="post-metadata">

**Author:** ![Francois\_Nature](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@Francois\_Nature](https://forum.ansible.com/u/Francois_Nature)\
**Post date:** [March 5, 2020, 5:40pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/2 "2020-03-05T17:40:50Z")

</div>

I meant I can use the AWX gui with no issue. Just wondering if I can use ansible cli as well

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 10, 2020, 12:39pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/3 "2020-03-10T12:39:30Z")

</div>

The whole point of using AWX is so that you don’t need the CLI, or rather that’s one of its selling points.

What I suggest, if you want to run ansible-playbook using the same inventories is for you to create an external inventory script which accesses AWX. Then you have users who can run jobs from AWX and others who run jobs locally on the command line.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [March 10, 2020, 12:47pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/4 "2020-03-10T12:47:33Z")

</div>

I respectfully have a different perspective. One of Awx/tower strengths is that it allows you to share your automation with rbac capability. If you log in as a particular user you only get to see certain job templates. I can then run that from any cli that I need to. Consider the command line. How can you share a playbook with just enough permission to do a certain task? It’s not that easy without things being disjointed. Awx /tower does have a cli. In fact I have used it and it works a treat. There is the deprecated tower-cli and awx-cli. Both work.

– You received this message because you are subscribed to the Google Groups “AWX Project” group. To unsubscribe from this group and stop receiving emails from it, send an email to . To view this discussion on the web visit .

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 10, 2020, 12:52pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/5 "2020-03-10T12:52:18Z")

</div>

> I respectfully have a different perspective.

Right you are!

I interpreted OP’s question as wanting to run on command-line only in spite of having AWX, due mainly to this “I can’t do any local cli on the server with ansible directly”.

I quite agree that using the API (or by extention the deprecated tower-cli or the new awx-cli) are the way to provide access to running playbooks withing AWX to humans, and t o machines.

-JP

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [March 10, 2020, 12:57pm UTC](https://forum.ansible.com/t/how-to-run-ansible-cli-in-awx/32395/6 "2020-03-10T12:57:31Z")

</div>

Going off topic The rest api is amazing. I am a windows guy but trade and I use a powershell module called ansibletower to wrap around the rest api’s.

– You received this message because you are subscribed to the Google Groups “AWX Project” group. To unsubscribe from this group and stop receiving emails from it, send an email to . To view this discussion on the web visit .
