-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_device_wMgmtIntIP_inRack_inTenant_inRack_inSite.yml
50 lines (39 loc) · 2.04 KB
/
create_device_wMgmtIntIP_inRack_inTenant_inRack_inSite.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
# ======= How to run:
# boburciu@WX-5CG020BDT2: ~$ cd ~/netbox-ansible-automation
# boburciu@WX-5CG020BDT2:~/netbox-ansible-automation$ ansible-playbook -i ./hosts -v create_device_wMgmtIntIP_inRack_inTenant_inRack_inSite.yml
# boburciu@WX-5CG020BDT2:~/netbox-ansible-automation$ ansible-playbook -i ./hosts -v create_device_wMgmtIntIP_inRack_inTenant_inRack_inSite.yml -e 'external_vars="../parse_excel_servers/external_vars_CZ00CHASSIS1.yml"'
---
- name: Add an device with its primary interface IP assigned, in a specific rack, dedicated tenant and site, with all dependencies created at playbook runtime
hosts: docker_netbox_19216820023
gather_facts: False
collections:
- netbox.netbox
tasks:
# - include_vars: external_vars.yml # where "url_var: http://192.168.200.23:8001/"
- include_vars: '{{external_vars}}'
- name: 1st, create the tags to be used
import_playbook: create_tag.yml
- name: 2nd, create the region (prereq. for site)
import_playbook: create_region.yml
vars:
region_name: EMEA
- name: 3rd, create the site (prereq. for rack group)
import_playbook: create_site.yml
vars:
site_description: 'Orange DC in Romania, Bucharest' # does not take precendence to the included vars, which have to be overwritten with -e / --extra-var at playbook runtime
- name: 4th, create the rack group, rack role and rack
import_playbook: create_rack.yml
- name: 5th, create the tenant group and tenant
import_playbook: create_tenant.yml
- name: 6th, create the device manufacturer, its type/model and role
import_playbook: create_device_manufacturer_type_role.yml
- name: 7th, create the device
import_playbook: create_device.yml
- name: 8th, create the Mgmt interface
import_playbook: create_interface.yml
- name: 9th, create the VRF
import_playbook: create_vrf.yml
- name: 10th, create the IP address
import_playbook: create_ip_addr.yml
- name: 11th, update the device by attaching the primary IP address to its Mgmt interface
import_playbook: create_device.yml