Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_vnic_template.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_vnic_template
3 - hosts: ucs
4 connection: local
5 gather_facts: false
6
7 tasks:
8 - name: Test that we have a UCS hostname, UCS username, and UCS password
9 fail:
10 msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
11 when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
12 vars:
13 # use "<<: *login_info" to substite the information below in each task
14 # this is not required, however it makes the playbook shorter.
15 login_info: &login_info
16 hostname: "{{ ucs_hostname }}"
17 username: "{{ ucs_username }}"
18 password: "{{ ucs_password }}"
19
20 - name: Add UCS Organization
21 cisco.ucs.ucs_org:
22 <<: *login_info
23 org_name: level1
24 parent_org_path: root
25 description: level1 org
26 state: present
27 delegate_to: localhost
28
29 - name: Configure vNIC template
30 cisco.ucs.ucs_vnic_template:
31 <<: *login_info
32 name: vNIC-A
33 org_dn: org-root/org-level1
34 fabric: A
35 vlans_list:
36 - name: default
37 native: 'yes'
38 - name: vlan200
39 native: 'no'
40 multicast_policy: default
41 fabric: A
42 id: '200'
43 sharing: none
44 delegate_to: localhost
45
46 - name: Remove VLAN from template
47 cisco.ucs.ucs_vnic_template:
48 <<: *login_info
49 name: vNIC-A
50 org_dn: org-root/org-level1
51 fabric: A
52 vlans_list:
53 - name: vlan200
54 state: absent
55 delegate_to: localhost
56
57 - name: Configure vNIC template for failover
58 cisco.ucs.ucs_vnic_template:
59 <<: *login_info
60 name: vNIC-A-B
61 org_dn: org-root/org-level1
62 fabric: A-B
63 redundancy_type: primary
64 vlans_list:
65 - name: default
66 native: 'yes'
67 - name: vlan200
68 native: 'no'
69 delegate_to: localhost
70
71 - name: Configure vNIC template for failover
72 cisco.ucs.ucs_vnic_template:
73 <<: *login_info
74 name: vNIC-B-A
75 org_dn: org-root/org-level1
76 fabric: B-A
77 redundancy_type: secondary
78 vlans_list:
79 - name: default
80 native: 'yes'
81 - name: vlan200
82 native: 'no'
83 delegate_to: localhost
84
85
86 - name: Remove vNIC template
87 cisco.ucs.ucs_vnic_template:
88 <<: *login_info
89 name: vNIC-A-B
90 org_dn: org-root/org-level1
91 state: absent
92 delegate_to: localhost
93
94 - name: Remove vNIC template
95 cisco.ucs.ucs_vnic_template:
96 <<: *login_info
97 name: vNIC-B-A
98 org_dn: org-root/org-level1
99 state: absent
100 delegate_to: localhost
101
102 - name: Remove UCS Organization
103 cisco.ucs.ucs_org:
104 <<: *login_info
105 org_name: level1
106 parent_org_path: root
107 state: absent
108 delegate_to: localhost