cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
631
Views
1
Helpful
1
Replies

Ansible with netbox as inventory

rasmus.elmholt
Level 7
Level 7

Hi all,

We are using netbox as our SoT and now I want to use ansible to push some configuration to the devices we have in Netbox.

I have made the inventory file and I am getting information from Netbox. But I cannot figure out how to set the ansible_network_os to "ios" and not the platform.slug.

Right now I use IOS-XE as the platform slug for all cat9k switches but ansible expects it to be ios.

My netbox_inventory file:

---
plugin: netbox.netbox.nb_inventory
validate_certs: false
config_context: false
compose:
  ansible_network_os: platform.slug

group_by:
  - device_roles
  - sites
query_filters:
  - status: active
  - tag: ansible
device_query_filters:
  - has_primary_ip: 'true'

Any help to set the ansible_network_os fixed to "ios" is appreciated. 

 

 

 

1 Accepted Solution

Accepted Solutions

rasmus.elmholt
Level 7
Level 7

Setting the value to '"ios"' solved the issue it just needed to be double qouted.

compose:
ansible_network_os: '"ios"'

View solution in original post

1 Reply 1

rasmus.elmholt
Level 7
Level 7

Setting the value to '"ios"' solved the issue it just needed to be double qouted.

compose:
ansible_network_os: '"ios"'