-
Notifications
You must be signed in to change notification settings - Fork 0
/
ip_addr.yml
62 lines (60 loc) · 2.12 KB
/
ip_addr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- name: Create Tenant
connection: local
hosts: docker_netbox_19216820023
gather_facts: True
tasks:
- name: Create tenant with all parameters
netbox_tenant:
netbox_url: http://192.168.200.23:8001/
netbox_token: b6383aa3e6c35d1eccf2fc09635ed0caeb6fe7c7
data:
name: Test_Tenant
description: ABC Incorporated
comments: '### This tenant is super cool'
slug: tenant_abc
# tags:
# - tagA
state: present
# query a list of devices
- name: Obtain list of tenants from Netbox
debug:
msg: >
"Device {{ item.value.name }} (ID: {{ item.key }}) was"
# manufactured by {{ item.value.device_type.manufacturer.name }}"
loop: "{{ query('netbox.netbox.nb_lookup', 'tenants',
api_endpoint='http://192.168.200.23:8001/',
token='b6383aa3e6c35d1eccf2fc09635ed0caeb6fe7c7') }}"
- name: Obtain id of specific tenant from Netbox
debug:
msg: "{{ query('netbox.netbox.nb_lookup', 'tenants',
api_filter='name=Test_Tenant',
api_endpoint='http://192.168.200.23:8001/',
token='b6383aa3e6c35d1eccf2fc09635ed0caeb6fe7c7') }}"
- name: Create vrf with all information
netbox_vrf:
netbox_url: http://192.168.200.23:8001/
netbox_token: b6383aa3e6c35d1eccf2fc09635ed0caeb6fe7c7
data:
name: Test_VRF
rd: "65000:1"
tenant: 3
# enforce_unique: true
description: VRF description
# tags:
# - Test_Ansible
state: present
- name: Create IP address with several specified options
netbox_ip_address:
netbox_url: http://192.168.200.23:8001/
netbox_token: b6383aa3e6c35d1eccf2fc09635ed0caeb6fe7c7
data:
family: 4
address: 192.168.201.1
vrf: Test_VRF
tenant: 3
status: Reserved
role: Loopback
description: Test description
# tags:
# - Test_Ansible NE40E
state: present