summaryrefslogtreecommitdiffstats
path: root/ansible/deployment_poc/tasks/netbox_query_interface.yml
blob: 7ad7c6322e834e2fea946e64d828d43468fe00a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
- 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"