summaryrefslogtreecommitdiffstats
path: root/ansible/deployment_poc/tasks/netbox_query_vm.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/deployment_poc/tasks/netbox_query_vm.yml')
-rw-r--r--ansible/deployment_poc/tasks/netbox_query_vm.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/ansible/deployment_poc/tasks/netbox_query_vm.yml b/ansible/deployment_poc/tasks/netbox_query_vm.yml
new file mode 100644
index 0000000..52308f0
--- /dev/null
+++ b/ansible/deployment_poc/tasks/netbox_query_vm.yml
@@ -0,0 +1,15 @@
+---
+ # consider ditching this block, would need to work around missing cluster ID in hostvars
+- name: Query VM
+ ansible.builtin.uri:
+ url: "{{ endpoint }}/virtualization/virtual-machines/?name={{ inventory_hostname }}"
+ client_cert: "{{ cert }}"
+ client_key: "{{ key }}"
+ method: GET
+ return_content: yes
+ headers:
+ Accept: application/json
+ Authorization: "Token {{ token }}"
+ register: nb_vm
+ delegate_to: localhost
+