Debian Codegraph @

ansible_collections/cisco/mso/tests/integration/targets/mso_role/tasks/main.yml

raw symbols SCIP
1 # Test code for the MSO 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 MultiSite host, username and password
7 ansible.builtin.fail:
8 msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
9 when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
10
11
12 # CLEAN ENVIRONMENT
13 - name: Set vars
14 ansible.builtin.set_fact:
15 mso_info: &mso_info
16 host: '{{ mso_hostname }}'
17 username: '{{ mso_username }}'
18 password: '{{ mso_password }}'
19 validate_certs: '{{ mso_validate_certs | default(false) }}'
20 use_ssl: '{{ mso_use_ssl | default(true) }}'
21 use_proxy: '{{ mso_use_proxy | default(true) }}'
22 output_level: '{{ mso_output_level | default("debug") }}'
23
24 - name: Query MSO version
25 cisco.mso.mso_version:
26 <<: *mso_info
27 state: query
28 register: version
29
30 - name: Execute tasks only for MSO version < 5.0
31 when: version.current.version is version('5.0', '<')
32 block:
33
34 - name: Set version vars
35 ansible.builtin.set_fact:
36 cisco.mso.mso_rw: true
37 when:
38 - version.current.version is version('2.2.4', '<')
39
40 - name: Import tasks if RW of role in this MSO version
41 ansible.builtin.import_tasks: role-rw.yml
42 when: mso_rw is defined
43
44 - name: Import tasks if RO of role in this MSO version
45 ansible.builtin.import_tasks: role-ro.yml
46 when:
47 - mso_rw is not defined
48 - version.current.version is version('3.2', '<')