Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/python_requirements_info/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Make sure setuptools is installed
12 pip:
13 name: setuptools
14 state: present
15 when: ansible_facts.distribution == 'MacOSX' and ansible_facts.distribution_version is version('15', '>=')
16
17 - name: run python_requirements_info module
18 python_requirements_info:
19 register: basic_info
20
21 - name: ensure python_requirements_info returns desired info
22 assert:
23 that:
24 - "'python' in basic_info"
25 - "'python_version' in basic_info"
26 - basic_info.python_version_info == ansible_facts.python.version
27
28 - name: run python_requirements_info module
29 python_requirements_info:
30 dependencies:
31 - notreal<1
32 - pip>1
33 register: dep_info
34
35 - name: ensure python_requirements_info returns desired info
36 assert:
37 that:
38 - "'installed' in dep_info.valid.pip"
39 - "'notreal' in dep_info.not_found"
40
41 - name: wrong specs
42 python_requirements_info:
43 dependencies:
44 - ansible<
45 register: wrong_spec1
46 ignore_errors: true
47
48 - name: ensure wrong specs return error
49 assert:
50 that:
51 - wrong_spec1 is failed