mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Improve CI (#281)
* Install PyOpenSSL and cryptography from PyPi if target Python != system Python. * Work around some CentOS6, 7, Ubuntu 16.04 problems. Improve jinja2 compatibility handling. * Skip tasks that require properties that aren't always there. * Only install OpenSSL when not present. * Improve output. * Improve get_certificate integration test graceful failing. * Fix tests. * Fix assert. * OpenSSL peculiarities. * Fix condition.
This commit is contained in:
55
tests/integration/targets/setup_python_info/tasks/main.yml
Normal file
55
tests/integration/targets/setup_python_info/tasks/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
- name: Gather facts on controller
|
||||
setup:
|
||||
gather_subset: '!all'
|
||||
delegate_to: localhost
|
||||
delegate_facts: true
|
||||
run_once: true
|
||||
- name: Show variables
|
||||
debug:
|
||||
msg: |-
|
||||
Target:
|
||||
Python: {{ ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor }}
|
||||
OS family: {{ ansible_facts.os_family }}
|
||||
Distribution: {{ ansible_facts.distribution }}
|
||||
Distribution version: {{ ansible_facts.distribution_version | internal__get_major_minor_version }}
|
||||
Distribution major version: {{ ansible_facts.distribution_major_version }}
|
||||
|
||||
Controller:
|
||||
Python: {{ hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor }}
|
||||
OS family: {{ hostvars['localhost'].ansible_facts.os_family }}
|
||||
Distribution: {{ hostvars['localhost'].ansible_facts.distribution }}
|
||||
Distribution version: {{ hostvars['localhost'].ansible_facts.distribution_version | internal__get_major_minor_version }}
|
||||
Distribution major version: {{ hostvars['localhost'].ansible_facts.distribution_major_version }}
|
||||
- name: Record information
|
||||
set_fact:
|
||||
target_system_python: >-
|
||||
{{
|
||||
(ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor)
|
||||
in
|
||||
(
|
||||
system_python_version_data[ansible_facts.distribution] |
|
||||
default(system_python_version_data[ansible_facts.os_family])
|
||||
)[ansible_facts.distribution_version | internal__get_major_minor_version]
|
||||
| default(
|
||||
(
|
||||
system_python_version_data[ansible_facts.distribution] |
|
||||
default(system_python_version_data[ansible_facts.os_family])
|
||||
)[ansible_facts.distribution_major_version]
|
||||
)
|
||||
}}
|
||||
controller_system_python: >-
|
||||
{{
|
||||
(hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor)
|
||||
in
|
||||
(
|
||||
system_python_version_data[hostvars['localhost'].ansible_facts.distribution] |
|
||||
default(system_python_version_data[hostvars['localhost'].ansible_facts.os_family])
|
||||
)[ansible_facts.distribution_version | internal__get_major_minor_version]
|
||||
| default(
|
||||
(
|
||||
system_python_version_data[hostvars['localhost'].ansible_facts.distribution] |
|
||||
default(system_python_version_data[hostvars['localhost'].ansible_facts.os_family])
|
||||
)[hostvars['localhost'].ansible_facts.distribution_major_version]
|
||||
)
|
||||
}}
|
||||
Reference in New Issue
Block a user