-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_site.yml
34 lines (32 loc) · 1.4 KB
/
create_site.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
# ======= How to run w non-root Ansible user:
# boburciu@WX-5CG020BDT2: ~$ cd ~/netbox-ansible-automation
# boburciu@WX-5CG020BDT2:~/netbox-ansible-automation$ ansible-playbook -i ./hosts -v create_tag.yml -e 'external_vars="../parse_excel_servers/external_vars_CZ00CHASSIS1.yml"'
- name: Create Site
connection: local
hosts: docker_netbox_19216820023
gather_facts: False
collections:
- netbox.netbox
tasks:
# - include_vars: external_vars.yml
- include_vars: '{{external_vars}}'
- name: Create site with all parameters
netbox_site:
netbox_url: '{{ url_var }}'
netbox_token: '{{ token_var }}'
data:
name: '{{ site_name }}'
status: '{{ site_status }}'
region: '{{ site_region }}'
facility: '{{ site_facility }}'
asn: '{{ site_asn }}'
time_zone: '{{ site_time_zone }}'
description: '{{ site_description }}'
physical_address: '{{ site_physical_address }}'
shipping_address: '{{ site_shipping_address }}'
latitude: '{{ site_latitude }}'
longitude: '{{ site_longitude }}'
contact_name: '{{ site_contact_name }}'
contact_phone: '{{ site_contact_phone }}'
contact_email: '{{ site_contact_email }}'
state: present # prevent duplicate prefixes/IP addresses within this VRF, true or false