# cannot run playbooks inside awx

**URL:** <https://forum.ansible.com/t/cannot-run-playbooks-inside-awx/32521>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 24, 2020, 11:46am UTC](https://forum.ansible.com/t/cannot-run-playbooks-inside-awx/32521 "2020-03-24T11:46:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dieye\_Pape\_Doudou](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dieye\_Pape\_Doudou](https://forum.ansible.com/u/Dieye_Pape_Doudou)\
**Post date:** [March 24, 2020, 11:46am UTC](https://forum.ansible.com/t/cannot-run-playbooks-inside-awx/32521/1 "2020-03-24T11:46:39Z")

</div>

Hello i’m a new user of AWX  
i can run a simple playbooks inside my VM ( Centos 7) but not inside AWX

i have the following error :

ansible-playbook 2.9.3

2  
config file = /etc/ansible/ansible.cfg

3  
configured module search path = [‘/home/awx/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]

4  
ansible python module location = /usr/lib/python3.6/site-packages/ansible

5  
executable location = /usr/bin/ansible-playbook

6  
python version = 3.6.8 (default, Nov 21 2019, 19:31:34) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]

7  
Using /etc/ansible/ansible.cfg as config file

8  
host\_list declined parsing /tmp/awx\_210\_1v0nihtb/tmp7020ud\_v as it did not pass its verify\_file() method

9  
Parsed /tmp/awx\_210\_1v0nihtb/tmp7020ud\_v inventory source with script plugin

10

11  
PLAYBOOK: mariadb.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

12  
1 plays in mariadb.yml

13

14  
PLAY [MariaDB] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10:59:44

15

16  
TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10:59:44

17  
task path: /tmp/awx\_210\_1v0nihtb/project/mariadb.yml:4

18  
\<127.0.0.1\> ESTABLISH LOCAL CONNECTION FOR USER: root

19  
\<127.0.0.1\> EXEC /bin/sh -c ‘echo ~root && sleep 0’

20  
\<127.0.0.1\> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932`” && echo ansible-tmp-1585043984.451582-19822062308932=“`echo /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932`” ) && sleep 0’

21  
Using module file /usr/lib/python3.6/site-packages/ansible/modules/system/setup.py

22  
\<127.0.0.1\> PUT /home/awx/.ansible/tmp/ansible-local-2483vpufk69g/tmpn0taicr2 TO /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932/AnsiballZ\_setup.py

23  
\<127.0.0.1\> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932/ /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932/AnsiballZ\_setup.py && sleep 0’

24  
\<127.0.0.1\> EXEC /bin/sh -c ‘/usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932/AnsiballZ\_setup.py && sleep 0’

25  
\<127.0.0.1\> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1585043984.451582-19822062308932/ \> /dev/null 2\>&1 && sleep 0’

26  
ok: [localhost]

27  
META: ran handlers

28

29  
TASK [install mariadb] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10:59:46

30  
task path: /tmp/awx\_210\_1v0nihtb/project/mariadb.yml:11

31  
\<127.0.0.1\> ESTABLISH LOCAL CONNECTION FOR USER: root

32  
\<127.0.0.1\> EXEC /bin/sh -c ‘echo ~root && sleep 0’

33  
\<127.0.0.1\> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531`” && echo ansible-tmp-1585043987.0660717-29791779719531=“`echo /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531`” ) && sleep 0’

34  
Using module file /usr/lib/python3.6/site-packages/ansible/modules/packaging/os/dnf.py

35  
\<127.0.0.1\> PUT /home/awx/.ansible/tmp/ansible-local-2483vpufk69g/tmphntb6aak TO /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531/AnsiballZ\_dnf.py

36  
\<127.0.0.1\> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531/ /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531/AnsiballZ\_dnf.py && sleep 0’

37  
\<127.0.0.1\> EXEC /bin/sh -c ‘/usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531/AnsiballZ\_dnf.py && sleep 0’

38  
\<127.0.0.1\> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1585043987.0660717-29791779719531/ \> /dev/null 2\>&1 && sleep 0’

39  
The full traceback is:

40  
File “/tmp/ansible\_dnf\_payload\_ppr8198k/ansible\_dnf\_payload.zip/ansible/modules/packaging/os/dnf.py”, line 649, in \_base

41  
File “/usr/lib/python3.6/site-packages/dnf/base.py”, line 406, in fill\_sack

42  
self.\_add\_repo\_to\_sack(r)

43  
File “/usr/lib/python3.6/site-packages/dnf/base.py”, line 136, in \_add\_repo\_to\_sack

44  
repo.load()

45  
File “/usr/lib/python3.6/site-packages/dnf/repo.py”, line 558, in load

46  
raise dnf.exceptions.RepoError(str(e))

47

48  
fatal: [localhost]: FAILED! =\> {

49  
“changed”: false,

50  
“invocation”: {

51  
“module\_args”: {

52  
“allow\_downgrade”: false,

53  
“autoremove”: false,

54  
“bugfix”: false,

55  
“conf\_file”: null,

56  
“disable\_excludes”: null,

57  
“disable\_gpg\_check”: false,

58  
…  
“msg”: “Failed to download metadata for repo ‘google-cloud-sdk’”,

…

87

88  
PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10:59:49

89  
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

\*\* I have 2 versions of python but i use python 2.7.5  
\*\* My playbook :

> **(attachments)**
>
> ![Capture2.PNG](https://us1.discourse-cdn.com/ansible/original/2X/3/3dbf759898df843131f3845f07ab3ceeb83ea883.png)  
> ![Capture3.PNG](https://us1.discourse-cdn.com/ansible/original/2X/d/d7ab5f50f02585738af4a047a8a8bf474c14d06d.png)  
> ![Capture4.PNG](https://us1.discourse-cdn.com/ansible/original/2X/5/572545c7b5b267d48c38ea42f270273c378cea67.png)

---

<div class="post-metadata">

**Author:** ![john.westcott.iv](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/john.westcott.iv/32/95_2.png) [@john.westcott.iv](https://forum.ansible.com/u/john.westcott.iv)\
**Post date:** [March 24, 2020, 12:01pm UTC](https://forum.ansible.com/t/cannot-run-playbooks-inside-awx/32521/2 "2020-03-24T12:01:51Z")

</div>

In your playbook you have your target set to localhost (which would be the AWX container).  
There some protections in place so that a playbook can’t alter the Tower server which is why the gather facts task runs but not the yum task.

Try changing your hosts directive to ‘all’ or something more appropriate like a group called maria\_db (if you do a group make sure that the group is in your Tower inventory).  
That will have Ansible target your two machines in the ‘inventory GT’ inventory.

Note: you will also likely need some kind of credential configured to get from the AWX container out to the target machines.

-John

---

<div class="post-metadata">

**Author:** ![Dieye\_Pape\_Doudou](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dieye\_Pape\_Doudou](https://forum.ansible.com/u/Dieye_Pape_Doudou)\
**Post date:** [March 26, 2020, 9:55pm UTC](https://forum.ansible.com/t/cannot-run-playbooks-inside-awx/32521/3 "2020-03-26T21:55:53Z")

</div>

thanks You John ! it’s running now !
