1 year ago

#325712

test-img

SPR

Ansible AWX Netbox Inventory

I have a issue with getting a list of host from Netbox. I made a github projects everything is syncing okey but when i try add a source for a inventory it doesnt show my any inventory file.

Output from sync project:


PLAY [Update source tree if necessary] *****************************************
TASK [delete project directory before update] **********************************
changed: [localhost]
TASK [update project using git] ************************************************
changed: [localhost]
TASK [Set the git repository version] ******************************************
ok: [localhost]
TASK [Repository Version] ******************************************************
ok: [localhost] => {
    "msg": "Repository Version 8e30557350896e2765258791af1645115db4be27"
}
PLAY [Install content with ansible-galaxy command if necessary] ****************
TASK [detect roles/requirements.(yml/yaml)] ************************************
skipping: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'item': {'ext': '.yml'}, 'ansible_loop_var': 'item'}) 
skipping: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'item': {'ext': '.yaml'}, 'ansible_loop_var': 'item'}) 
TASK [detect collections/requirements.(yml/yaml)] ******************************
skipping: [localhost] => (item={'ext': '.yml'}) 
skipping: [localhost] => (item={'ext': '.yaml'}) 
TASK [fetch galaxy collections from collections/requirements.(yml/yaml)] *******
skipping: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'item': {'ext': '.yml'}, 'ansible_loop_var': 'item'}) 
skipping: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'item': {'ext': '.yaml'}, 'ansible_loop_var': 'item'}) 
PLAY RECAP *********************************************************************
localhost                  : ok=4    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0 

Someone have any idea? I have nearly 2000 ip address to add and there is no way to write static inventory because every day there are coming 5-7 new ip addresses.

GITHUB:

roles/requirements.yml

---
collections:

- name: netbox.netbox

inventory.yml

---
plugin: netbox
api_endpoint: http://172.28.5.14
validate_certs: false
config_context: false
token: 
group_by:
  - device_roles
compose:
  ansible_network_os: platform.slug

On AWX:

Project sourced from GitHub

When i try to create inventory with source from this project i don't see file from my github

ansible

ansible-awx

ansible-tower

netbox

0 Answers

Your Answer

Accepted video resources