-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathucs_vnic_template.yml
108 lines (98 loc) · 2.89 KB
/
ucs_vnic_template.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
# Example Playbook: cisco.ucs.ucs_vnic_template
- hosts: ucs
connection: local
gather_facts: false
tasks:
- name: Test that we have a UCS hostname, UCS username, and UCS password
fail:
msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
vars:
# use "<<: *login_info" to substite the information below in each task
# this is not required, however it makes the playbook shorter.
login_info: &login_info
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
- name: Add UCS Organization
cisco.ucs.ucs_org:
<<: *login_info
org_name: level1
parent_org_path: root
description: level1 org
state: present
delegate_to: localhost
- name: Configure vNIC template
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-A
org_dn: org-root/org-level1
fabric: A
vlans_list:
- name: default
native: 'yes'
- name: vlan200
native: 'no'
multicast_policy: default
fabric: A
id: '200'
sharing: none
delegate_to: localhost
- name: Remove VLAN from template
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-A
org_dn: org-root/org-level1
fabric: A
vlans_list:
- name: vlan200
state: absent
delegate_to: localhost
- name: Configure vNIC template for failover
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-A-B
org_dn: org-root/org-level1
fabric: A-B
redundancy_type: primary
vlans_list:
- name: default
native: 'yes'
- name: vlan200
native: 'no'
delegate_to: localhost
- name: Configure vNIC template for failover
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-B-A
org_dn: org-root/org-level1
fabric: B-A
redundancy_type: secondary
vlans_list:
- name: default
native: 'yes'
- name: vlan200
native: 'no'
delegate_to: localhost
- name: Remove vNIC template
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-A-B
org_dn: org-root/org-level1
state: absent
delegate_to: localhost
- name: Remove vNIC template
cisco.ucs.ucs_vnic_template:
<<: *login_info
name: vNIC-B-A
org_dn: org-root/org-level1
state: absent
delegate_to: localhost
- name: Remove UCS Organization
cisco.ucs.ucs_org:
<<: *login_info
org_name: level1
parent_org_path: root
state: absent
delegate_to: localhost