# Error execute AWX Inventory script that connect to satellite server  to generate dynamic inventories

**URL:** <https://forum.ansible.com/t/error-execute-awx-inventory-script-that-connect-to-satellite-server-to-generate-dynamic-inventories/28867>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [October 25, 2018, 8:43am UTC](https://forum.ansible.com/t/error-execute-awx-inventory-script-that-connect-to-satellite-server-to-generate-dynamic-inventories/28867 "2018-10-25T08:43:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez\_Loza](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alberto\_Jimenez\_Loza](https://forum.ansible.com/u/Alberto_Jimenez_Loza)\
**Post date:** [October 25, 2018, 8:43am UTC](https://forum.ansible.com/t/error-execute-awx-inventory-script-that-connect-to-satellite-server-to-generate-dynamic-inventories/28867/1 "2018-10-25T08:43:36Z")

</div>

I want to use this Inventory Script in AWX that connect to my satellite server to generate dynamic inventories.

But when I execute update of the inventory, it appears this error.

1  
1.452 INFO Updating inventory 15: Inventory\_Satellite

2  
1.462 DEBUG Using system install of ansible-inventory CLI: /usr/bin/ansible-inventory

3  
1.462 INFO Reading Ansible inventory source: /tmp/awx\_46\_DXibrf/tmplbx1AV

4  
Traceback (most recent call last):

5  
File “/usr/bin/awx-manage”, line 9, in

6  
load\_entry\_point(‘awx==1.0.8.0’, ‘console\_scripts’, ‘awx-manage’)()

7  
File “/usr/lib/python2.7/site-packages/awx/ **init**.py”, line 116, in manage

8  
execute\_from\_command\_line(sys.argv)

9  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/ **init**.py”, line 364, in execute\_from\_command\_line

10  
utility.execute()

11  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/ **init**.py”, line 356, in execute

12  
self.fetch\_command(subcommand).run\_from\_argv(self.argv)

13  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py”, line 283, in run\_from\_argv

14  
self.execute(\*args, \*\*cmd\_options)

15  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py”, line 330, in execute

16  
output = self.handle(\*args, \*\*options)

17  
File “/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 994, in handle

18  
self.is\_custom)

19  
File “/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 245, in load\_inventory\_source

20  
is\_custom=is\_custom).load()

21  
File “/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 180, in load

22  
data = self.command\_to\_json(base\_args + [‘–list’])

23  
File “/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 163, in command\_to\_json

24  
self.method, proc.returncode, stdout, stderr))

25  
RuntimeError: ansible-inventory failed (rc=1) with stdout:

26

27  
stderr:

28  
**[WARNING]: \* Failed to parse /tmp/awx\_46\_DXibrf/tmplbx1AV with script plugin:**

29  
**Inventory script (/tmp/awx\_46\_DXibrf/tmplbx1AV) had an execution error: Error**

30  
**parsing configuration: No section: ‘foreman’**

31

32  
**[WARNING]: Unable to parse /tmp/awx\_46\_DXibrf/tmplbx1AV as an inventory source**

33

34  
ERROR! No inventory was parsed, please check your configuration and options.

INVENTORY SCRIPT

#!/usr/bin/env python

# vim: set fileencoding=utf-8 :

---

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez\_Loza](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alberto\_Jimenez\_Loza](https://forum.ansible.com/u/Alberto_Jimenez_Loza)\
**Post date:** [October 25, 2018, 11:08am UTC](https://forum.ansible.com/t/error-execute-awx-inventory-script-that-connect-to-satellite-server-to-generate-dynamic-inventories/28867/2 "2018-10-25T11:08:16Z")

</div>

I resolve the problem, the file with variables to connect to satellite server have to be in the docker web\_task and not in the server.  
It works OK.
