Hi
Not sure if I understood the question correctly but I was able to post data into Netbox with Ansible URI module
I'm doing a first call to get the Netbox object ID based on a name
- name: Find device in Netbox
local_action:
module: uri
url: "https://{{ netbox_addr }}/api/dcim/devices?name={{ inventory_hostname }}"
method: GET
headers:
Authorization: "Token {{ netbox_token }}"
status_code: 200
validate_certs: no
register: device
And later on I access the device id with
"{{ device.json.results[0].id }}"inventory_hostname is the slug of the device i'm looking for.
I think it would be great to get some native ansible module to manage the Netbox object, do you know if someone has started that ?
hope this help,
Damien