Skip to content

Commit dd976fc

Browse files
committed
nb_lookup: tests for v3.5-v4.0 too
Keeps the lookup files of v3.5 and v4.1 identical.
1 parent fefd4da commit dd976fc

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

tests/integration/targets/v3.5/tasks/netbox_lookup.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@
8888
vars:
8989
query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='id=1', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')
9090
}}"
91+
92+
- name: "NETBOX_LOOKUP 11: Device query by ansible variable"
93+
ansible.builtin.set_fact:
94+
hostname: "L2"
95+
96+
- name: "NETBOX LOOKUP 11.1: Obtain details of a single device from NetBox"
97+
ansible.builtin.debug:
98+
msg: >
99+
"Device {{item.0.value.display}} (ID: {{item.0.key}}) was
100+
manufactured by {{ item.0.value.device_type.manufacturer.name }}"
101+
loop:
102+
- '{{ query("netbox.netbox.nb_lookup", "devices",
103+
api_filter="name=" ~hostname,
104+
api_endpoint="http://localhost:32768",
105+
token="0123456789abcdef0123456789abcdef01234567") }}'

tests/integration/targets/v3.6/tasks/netbox_lookup.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@
8888
vars:
8989
query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='id=1', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')
9090
}}"
91+
92+
- name: "NETBOX_LOOKUP 11: Device query by ansible variable"
93+
ansible.builtin.set_fact:
94+
hostname: "L2"
95+
96+
- name: "NETBOX LOOKUP 11.1: Obtain details of a single device from NetBox"
97+
ansible.builtin.debug:
98+
msg: >
99+
"Device {{item.0.value.display}} (ID: {{item.0.key}}) was
100+
manufactured by {{ item.0.value.device_type.manufacturer.name }}"
101+
loop:
102+
- '{{ query("netbox.netbox.nb_lookup", "devices",
103+
api_filter="name=" ~hostname,
104+
api_endpoint="http://localhost:32768",
105+
token="0123456789abcdef0123456789abcdef01234567") }}'

tests/integration/targets/v3.7/tasks/netbox_lookup.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@
8888
vars:
8989
query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='id=1', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')
9090
}}"
91+
92+
- name: "NETBOX_LOOKUP 11: Device query by ansible variable"
93+
ansible.builtin.set_fact:
94+
hostname: "L2"
95+
96+
- name: "NETBOX LOOKUP 11.1: Obtain details of a single device from NetBox"
97+
ansible.builtin.debug:
98+
msg: >
99+
"Device {{item.0.value.display}} (ID: {{item.0.key}}) was
100+
manufactured by {{ item.0.value.device_type.manufacturer.name }}"
101+
loop:
102+
- '{{ query("netbox.netbox.nb_lookup", "devices",
103+
api_filter="name=" ~hostname,
104+
api_endpoint="http://localhost:32768",
105+
token="0123456789abcdef0123456789abcdef01234567") }}'

tests/integration/targets/v4.0/tasks/netbox_lookup.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@
8888
vars:
8989
query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='id=1', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')
9090
}}"
91+
92+
- name: "NETBOX_LOOKUP 11: Device query by ansible variable"
93+
ansible.builtin.set_fact:
94+
hostname: "L2"
95+
96+
- name: "NETBOX LOOKUP 11.1: Obtain details of a single device from NetBox"
97+
ansible.builtin.debug:
98+
msg: >
99+
"Device {{item.0.value.display}} (ID: {{item.0.key}}) was
100+
manufactured by {{ item.0.value.device_type.manufacturer.name }}"
101+
loop:
102+
- '{{ query("netbox.netbox.nb_lookup", "devices",
103+
api_filter="name=" ~hostname,
104+
api_endpoint="http://localhost:32768",
105+
token="0123456789abcdef0123456789abcdef01234567") }}'

0 commit comments

Comments
 (0)