mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Extend CI (#283)
* Run all tests on all targets. Remove hack in setup_acme. * Fix some failing tests. * OpenSSH tests do not work yet with default image on Ansible 2.9. Let's skip them on the cloud target. * Make tests pass again. * Make sure to install *latest* versions of cryptography and pyOpenSSL when not installing system packages, whenever possible. ci_complete * Update/fix aliases files.
This commit is contained in:
@@ -24,10 +24,31 @@ def get_major_minor_version(version):
|
||||
return '.'.join(parts)
|
||||
|
||||
|
||||
def version_lookup(data, distribution, os_family, distribution_version, distribution_major_version, python_version, default_value=False):
|
||||
if distribution in data:
|
||||
data = data[distribution]
|
||||
elif os_family in data:
|
||||
data = data[os_family]
|
||||
else:
|
||||
return default_value
|
||||
|
||||
if distribution_version in data:
|
||||
data = data[distribution_version]
|
||||
elif get_major_minor_version(distribution_version) in data:
|
||||
data = data[get_major_minor_version(distribution_version)]
|
||||
elif str(distribution_major_version) in data:
|
||||
data = data[str(distribution_major_version)]
|
||||
else:
|
||||
return default_value
|
||||
|
||||
return python_version in data
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
""" IP address and network manipulation filters """
|
||||
|
||||
def filters(self):
|
||||
return {
|
||||
'internal__get_major_minor_version': get_major_minor_version,
|
||||
'internal__version_lookup': version_lookup,
|
||||
}
|
||||
|
||||
@@ -25,31 +25,45 @@
|
||||
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]
|
||||
system_python_version_data |
|
||||
internal__version_lookup(
|
||||
ansible_facts.distribution,
|
||||
ansible_facts.os_family,
|
||||
ansible_facts.distribution_version,
|
||||
ansible_facts.distribution_major_version,
|
||||
ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor
|
||||
)
|
||||
}}
|
||||
target_system_python_cannot_upgrade_cryptography: >-
|
||||
{{
|
||||
cannot_upgrade_cryptography |
|
||||
internal__version_lookup(
|
||||
ansible_facts.distribution,
|
||||
ansible_facts.os_family,
|
||||
ansible_facts.distribution_version,
|
||||
ansible_facts.distribution_major_version,
|
||||
ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor
|
||||
)
|
||||
}}
|
||||
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]
|
||||
system_python_version_data |
|
||||
internal__version_lookup(
|
||||
hostvars['localhost'].ansible_facts.distribution,
|
||||
hostvars['localhost'].ansible_facts.os_family,
|
||||
hostvars['localhost'].ansible_facts.distribution_version,
|
||||
hostvars['localhost'].ansible_facts.distribution_major_version,
|
||||
hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor
|
||||
)
|
||||
}}
|
||||
controller_system_python_cannot_upgrade_cryptography: >-
|
||||
{{
|
||||
cannot_upgrade_cryptography |
|
||||
internal__version_lookup(
|
||||
hostvars['localhost'].ansible_facts.distribution,
|
||||
hostvars['localhost'].ansible_facts.os_family,
|
||||
hostvars['localhost'].ansible_facts.distribution_version,
|
||||
hostvars['localhost'].ansible_facts.distribution_major_version,
|
||||
hostvars['localhost'].ansible_facts.python.version.major ~ '.' ~ hostvars['localhost'].ansible_facts.python.version.minor
|
||||
)
|
||||
}}
|
||||
|
||||
@@ -48,3 +48,10 @@ system_python_version_data:
|
||||
'15':
|
||||
- '2.7'
|
||||
- '3.6'
|
||||
|
||||
cannot_upgrade_cryptography:
|
||||
FreeBSD:
|
||||
'12.2':
|
||||
- '3.8' # on the VMs in CI, system packages are used for this version as well
|
||||
'13.0':
|
||||
- '3.8' # on the VMs in CI, system packages are used for this version as well
|
||||
|
||||
Reference in New Issue
Block a user