Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_vlan_find.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_vlan_find
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: Get all vlans in fabric A
21 cisco.ucs.ucs_vlan_find:
22 <<: *login_info
23 fabric: 'common'
24 pattern: '.'
25 register: response
26 delegate_to: localhost
27
28 - name: show response
29 debug:
30 msg: "{{ response }}"
31
32 - name: Confirm if vlan 15 is present
33 cisco.ucs.ucs_vlan_find:
34 <<: *login_info
35 vlanid: '200'
36 register: response
37 delegate_to: localhost
38
39 - name: show response
40 debug:
41 msg: "{{ response }}"