Open rthomson opened 6 years ago
Here's an example netbox.yml
configuration using names, slugs and labels:
netbox:
main:
api_url: 'https://localhost/api/virtualization/virtual-machines/'
api_token: '1234567890'
group_by:
names:
- cluster
slugs:
- platform
custom:
- ansible_groups
hosts_vars:
ip:
netbox_primary_ip: primary_ip
ansible_host: primary_ip
names:
netbox_cluster: cluster
netbox_vcpus: vcpus
netbox_memory: memory
netbox_disk: disk
netbox_tenant: tenant
slugs:
netbox_role: role
netbox_platform: platform
labels:
netbox_status: status
custom:
ansible_user: ansible_user
ansible_port: ansible_port
netbox_ansible_configure: ansible_configure
Hello,
I think there is a little error in labels
key map,
self.key_map = {
...
"labels": "value",
shouldn't it be ?
self.key_map = {
...
"labels": "label",
If I'm correct, this should fix #17
Implements a very simple method for using
slug
,name
andlabel
fields from netbox API for group_by or host_vars as discussed in #4 and #22.This is not likely to be the "best" approach as it requires authors of the
netbox.yml
configuration file to know which fields they want to group_by or use for host_vars are of which type.This should be backwards compatible with existing YAML configurations.