-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.sites.yml
59 lines (55 loc) · 1.76 KB
/
1.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
- ansible.builtin.import_playbook: update.yml
- name : Add Site
gather_facts: false
hosts: all
vars:
- aci_login: &mso_login
hostname: "{{ ansible_host }}"
username: "{{ ansible_user }}"
password: "{{ ansible_password }}"
validate_certs: "{{ validate_certs }}"
tasks:
- name: Add a new DCNM site
cisco.mso.mso_rest:
<<: *mso_login
path: "/api/config/v2/addsite/"
method: post
content:
{
"url": "{{ item.controller_url }}",
"siteType": "{{ item.site_type }}",
"dcnm": {
"userName": "{{ item.controller_username }}",
"password": "{{ item.controller_password }}",
"siteList": [
{
"siteName": "{{ item.name }}",
"fabricName": "{{ item.name }}",
"fabricTechnology": "{{ item.dcnm_fabric_technology }}",
"fabricType": "{{ item.dcnm_fabric_type }}",
}
],
"loginDomain": "{{ item.login_domain }}",
},
"securityDomains": [ ]
}
delegate_to: localhost
loop: "{{ site }}"
when: site is defined
loop_control:
pause: 2
- name: Configure site as Managed by MSO
cisco.mso.mso_site:
<<: *mso_login
site: "{{ item.name }}"
apic_username: "{{ item.controller_username }}"
apic_password: "{{ item.controller_password }}"
apic_site_id: "{{ item.site_id | int }}"
urls:
- "{{ item.controller_url }}"
state: "{{ item.status if item.status is defined else omit }}"
loop: "{{ site }}"
delegate_to: localhost
when: site is defined
# ignore_errors: yes