Debian Codegraph @

ansible_collections/community/crypto/tests/integration/targets/setup_python_info/tasks/main.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Gather facts on controller
7 ansible.builtin.setup:
8 gather_subset: '!all'
9 delegate_to: localhost
10 delegate_facts: true
11 run_once: true
12 - name: Show variables
13 ansible.builtin.debug:
14 msg: |-
15 Target:
16 Python: {{ ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor }}
17 OS family: {{ ansible_facts.os_family }}
18 Distribution: {{ ansible_facts.distribution }}
19 Distribution version: {{ ansible_facts.distribution_version | internal__get_major_minor_version }}
20 Distribution major version: {{ ansible_facts.distribution_major_version }}
21
22 Controller:
23 Python: {{ hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor }}
24 OS family: {{ hostvars['localhost'].ansible_facts.os_family }}
25 Distribution: {{ hostvars['localhost'].ansible_facts.distribution }}
26 Distribution version: {{ hostvars['localhost'].ansible_facts.distribution_version | internal__get_major_minor_version }}
27 Distribution major version: {{ hostvars['localhost'].ansible_facts.distribution_major_version }}
28 - name: Record information
29 ansible.builtin.set_fact:
30 target_system_python: >-
31 {{
32 system_python_version_data |
33 internal__version_lookup(
34 ansible_facts.distribution,
35 ansible_facts.os_family,
36 ansible_facts.distribution_version,
37 ansible_facts.distribution_major_version,
38 ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor
39 )
40 }}
41 target_system_python_cannot_upgrade_cryptography: >-
42 {{
43 cannot_upgrade_cryptography |
44 internal__version_lookup(
45 ansible_facts.distribution,
46 ansible_facts.os_family,
47 ansible_facts.distribution_version,
48 ansible_facts.distribution_major_version,
49 ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor
50 )
51 }}
52 controller_system_python: >-
53 {{
54 system_python_version_data |
55 internal__version_lookup(
56 hostvars['localhost'].ansible_facts.distribution,
57 hostvars['localhost'].ansible_facts.os_family,
58 hostvars['localhost'].ansible_facts.distribution_version,
59 hostvars['localhost'].ansible_facts.distribution_major_version,
60 hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor
61 )
62 }}
63 controller_system_python_cannot_upgrade_cryptography: >-
64 {{
65 cannot_upgrade_cryptography |
66 internal__version_lookup(
67 hostvars['localhost'].ansible_facts.distribution,
68 hostvars['localhost'].ansible_facts.os_family,
69 hostvars['localhost'].ansible_facts.distribution_version,
70 hostvars['localhost'].ansible_facts.distribution_major_version,
71 hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor
72 )
73 }}