-
Notifications
You must be signed in to change notification settings - Fork 0
/
pb.mist.create.sites.yml
44 lines (42 loc) · 1.58 KB
/
pb.mist.create.sites.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
---
### ---------------------------------------------------------------------------
### CREATE A TON OF SITES IN MIST
### ---------------------------------------------------------------------------
- hosts: localhost
connection: local
gather_facts: False
become: False
roles:
### ---------------------------------------------------------------------------
### Netbox work
### ---------------------------------------------------------------------------
- { role: netbox_get_all_sites }
tasks:
- debug:
msg: "{{ all_sites }}"
### ---------------------------------------------------------------------------
### CREATE SITE IN MIST
### ---------------------------------------------------------------------------
- name: "Create a new site in Mist"
uri:
url: "https://{{ mist_wired.base_url }}/orgs/{{ mist_wired.id_org }}/sites"
method: POST
return_content: yes
status_code: "200"
headers:
Content-Type: "application/json"
Authorization: "Token {{ mist_wired.api_token }}"
body:
address: "{{ item.physical_address }}"
name: "{{ item.name }}"
latlng:
lat: "{{ item.latitude }}"
long: "{{ item.longitude }}"
notes: "{{ item.facility }}"
country_code: "US"
timezone: "America/Los_Angeles"
force_basic_auth: yes
body_format: json
when:
- item.name != "Seattle"
loop: "{{ all_sites }}"