Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.11 KB

Phase 3.md

File metadata and controls

36 lines (26 loc) · 1.11 KB

Phase 3: Configuring Ansible for Netbox

Before we start generating configurations with Ansible, we need to connect Ansible to Netbox.

In order to pull data from Netbox, we need to generate a token. This can be done in the administrative screen.

For more information on authentication methods visit the Authentication documentation

Otherwise, generate your token and copy it.

Phase 3 Token Screen

Now we need to create a yaml configuration file to use as the dynamic inventory for Ansible.

For more information on the netbox plugin, visit the Netbox Plugin documentation

My configuration file is below

---
plugin: netbox
api_endpoint: https://netbox-server-here
token: token-here
validate_certs: False
config_context: True
group_by:
  - device_roles
compose:
  ansible_network_os: platform.slug

Save this file as netbox_inventory.yml

You can test your integration by running

ansible-inventory -v --list -i netbox_inventory.yml