Debian Codegraph @

ansible_collections/cisco/aci/tests/integration/targets/aci_system/tasks/main.yml

raw symbols SCIP
1 # Test code for the ACI modules
2 # Copyright: (c) 2020, Lionel Hercot (@lhercot) <[email protected]>
3
4 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 - name: Test that we have an ACI APIC host, ACI username and ACI password
7 ansible.builtin.fail:
8 msg: 'Please define the following variables: aci_hostname, aci_username and aci_password.'
9 when: aci_hostname is not defined or aci_username is not defined or aci_password is not defined
10
11 # CLEAN ENVIRONMENT
12 - name: Set vars
13 ansible.builtin.set_fact:
14 aci_info: &aci_info
15 host: "{{ aci_hostname }}"
16 username: "{{ aci_username }}"
17 password: "{{ aci_password }}"
18 validate_certs: '{{ aci_validate_certs | default(false) }}'
19 use_ssl: '{{ aci_use_ssl | default(true) }}'
20 use_proxy: '{{ aci_use_proxy | default(true) }}'
21 output_level: '{{ aci_output_level | default("info") }}'
22
23 # QUERY OBJECTS
24 - name: Query all controllers system information
25 cisco.aci.aci_system:
26 <<: *aci_info
27 state: query
28 register: query_all
29
30 - name: Verify query_all
31 ansible.builtin.assert:
32 that:
33 - query_all is not changed
34 - query_all.current.0.topSystem.attributes.id == "1"
35 - '"version" in query_all.current.0.topSystem.attributes'
36
37
38 - name: Query a specific controller system information
39 cisco.aci.aci_system:
40 <<: *aci_info
41 id: 1
42 state: query
43 register: query_controller
44
45 - name: Verify query_controller
46 ansible.builtin.assert:
47 that:
48 - query_controller is not changed
49 - query_controller.current.0.topSystem.attributes.id == "1"
50 - '"version" in query_controller.current.0.topSystem.attributes'
51
52 - name: Query non_existing controller
53 cisco.aci.aci_system:
54 <<: *aci_info
55 id: 99
56 state: query
57 register: query_non_existing
58
59 - name: Verify query_non_existing
60 ansible.builtin.assert:
61 that:
62 - query_non_existing is not changed
63 - query_non_existing.current == []