system/ansible/deployment_poc/tasks/netbox_query_interface.yml

16 lines
430 B
YAML
Raw Normal View History

---
- name: Query existing interface
ansible.builtin.uri:
url: "{{ endpoint }}/virtualization/interfaces/?name=eth0&virtual_machine_id={{ id }}"
client_cert: "{{ cert }}"
client_key: "{{ key }}"
method: GET
return_content: yes
headers:
Accept: application/json
Authorization: "Token {{ token }}"
register: nb_interface_2
delegate_to: localhost
when: "nb_interface_1.status|int == 400"