1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Drop support for ansible-core 2.11 and 2.12 (#7269)

* Drop support for ansible-core 2.11 and 2.12.

Also move ansible-core 2.13 from regular CI to EOL CI.

* Remove some compatibility code.

* Remove no longer needed import.

* Update README.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2023-10-11 16:13:14 +02:00 committed by GitHub
parent 91fdc8e06a
commit 4ea40e9473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 148 deletions

View file

@ -244,10 +244,10 @@ stages:
parameters:
testFormat: 2.14/{0}
targets:
- name: RHEL 9.0
test: rhel/9.0
- name: macOS 12.0
test: macos/12.0
- name: RHEL 9.0
test: rhel/9.0
#- name: FreeBSD 12.4
# test: freebsd/12.4
groups:

View file

@ -29,23 +29,17 @@ jobs:
strategy:
matrix:
ansible:
- '2.11'
- '2.12'
- '2.13'
# Ansible-test on various stable branches does not yet work well with cgroups v2.
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
# image for these stable branches. The list of branches where this is necessary will
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
# for the latest list.
runs-on: >-
${{ contains(fromJson(
'["2.9", "2.10", "2.11"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
ansible-core-version: stable-${{ matrix.ansible }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
pull-request-change-detection: 'true'
@ -57,10 +51,7 @@ jobs:
# image for these stable branches. The list of branches where this is necessary will
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
# for the latest list.
runs-on: >-
${{ contains(fromJson(
'["2.9", "2.10", "2.11"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
name: EOL Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
@ -73,13 +64,9 @@ jobs:
exclude:
- ansible: ''
include:
- ansible: '2.11'
- ansible: '2.13'
python: '2.7'
- ansible: '2.11'
python: '3.5'
- ansible: '2.12'
python: '2.6'
- ansible: '2.12'
- ansible: '2.13'
python: '3.8'
- ansible: '2.13'
python: '2.7'
@ -92,7 +79,6 @@ jobs:
Ansible version ${{ matrix.ansible }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
ansible-core-version: stable-${{ matrix.ansible }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
pre-test-cmd: >-
@ -109,10 +95,7 @@ jobs:
# image for these stable branches. The list of branches where this is necessary will
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
# for the latest list.
runs-on: >-
${{ contains(fromJson(
'["2.9", "2.10", "2.11"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
runs-on: ubuntu-latest
name: EOL I (Ⓐ${{ matrix.ansible }}+${{ matrix.docker }}+py${{ matrix.python }}:${{ matrix.target }})
strategy:
fail-fast: false
@ -128,94 +111,6 @@ jobs:
exclude:
- ansible: ''
include:
# 2.11
- ansible: '2.11'
docker: fedora32
python: ''
target: azp/posix/1/
- ansible: '2.11'
docker: fedora32
python: ''
target: azp/posix/2/
- ansible: '2.11'
docker: fedora32
python: ''
target: azp/posix/3/
- ansible: '2.11'
docker: fedora33
python: ''
target: azp/posix/1/
- ansible: '2.11'
docker: fedora33
python: ''
target: azp/posix/2/
- ansible: '2.11'
docker: fedora33
python: ''
target: azp/posix/3/
- ansible: '2.11'
docker: alpine3
python: ''
target: azp/posix/1/
- ansible: '2.11'
docker: alpine3
python: ''
target: azp/posix/2/
- ansible: '2.11'
docker: alpine3
python: ''
target: azp/posix/3/
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - ansible: '2.11'
# docker: default
# python: '2.7'
# target: azp/generic/1/
# - ansible: '2.11'
# docker: default
# python: '3.5'
# target: azp/generic/1/
# 2.12
- ansible: '2.12'
docker: centos6
python: ''
target: azp/posix/1/
- ansible: '2.12'
docker: centos6
python: ''
target: azp/posix/2/
- ansible: '2.12'
docker: centos6
python: ''
target: azp/posix/3/
- ansible: '2.12'
docker: fedora34
python: ''
target: azp/posix/1/
- ansible: '2.12'
docker: fedora34
python: ''
target: azp/posix/2/
- ansible: '2.12'
docker: fedora34
python: ''
target: azp/posix/3/
- ansible: '2.12'
docker: ubuntu1804
python: ''
target: azp/posix/1/
- ansible: '2.12'
docker: ubuntu1804
python: ''
target: azp/posix/2/
- ansible: '2.12'
docker: ubuntu1804
python: ''
target: azp/posix/3/
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - ansible: '2.12'
# docker: default
# python: '3.8'
# target: azp/generic/1/
# 2.13
- ansible: '2.13'
docker: fedora35
@ -266,7 +161,6 @@ jobs:
under Python ${{ matrix.python }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
ansible-core-version: stable-${{ matrix.ansible }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
docker-image: ${{ matrix.docker }}

View file

@ -24,9 +24,7 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
## Tested with Ansible
Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16 releases and the current development version of ansible-core. Ansible-core versions before 2.11.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
Parts of this collection will not work with ansible-core 2.11 on Python 3.12+.
Tested with the current ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16 releases and the current development version of ansible-core. Ansible-core versions before 2.13.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
## External requirements

View file

@ -0,0 +1,12 @@
removed_features:
- "The collection no longer supports ansible-core 2.11 and ansible-core 2.12.
Parts of the collection might still work on these ansible-core versions, but others might not
(https://github.com/ansible-collections/community.general/pull/7269)."
breaking_changes:
- "selective callback plugin - remove compatibility code for Ansible 2.9 and ansible-core 2.10
(https://github.com/ansible-collections/community.general/pull/7269)."
- "collection_version lookup plugin - remove compatibility code for ansible-base 2.10 and ansible-core 2.11
(https://github.com/ansible-collections/community.general/pull/7269)."
- "version module util - remove fallback for ansible-core 2.11. All modules and plugins that do
version collections no longer work with ansible-core 2.11
(https://github.com/ansible-collections/community.general/pull/7269)."

View file

@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
requires_ansible: '>=2.11.0'
requires_ansible: '>=2.13.0'
plugin_routing:
connection:
docker:

View file

@ -44,26 +44,17 @@ from ansible import constants as C
from ansible.plugins.callback import CallbackBase
from ansible.module_utils.common.text.converters import to_text
try:
codeCodes = C.COLOR_CODES
except AttributeError:
# This constant was moved to ansible.constants in
# https://github.com/ansible/ansible/commit/1202dd000f10b0e8959019484f1c3b3f9628fc67
# (will be included in ansible-core 2.11.0). For older Ansible/ansible-base versions,
# we include from the original location.
from ansible.utils.color import codeCodes
DONT_COLORIZE = False
COLORS = {
'normal': '\033[0m',
'ok': '\033[{0}m'.format(codeCodes[C.COLOR_OK]),
'ok': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_OK]),
'bold': '\033[1m',
'not_so_bold': '\033[1m\033[34m',
'changed': '\033[{0}m'.format(codeCodes[C.COLOR_CHANGED]),
'failed': '\033[{0}m'.format(codeCodes[C.COLOR_ERROR]),
'changed': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_CHANGED]),
'failed': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_ERROR]),
'endc': '\033[0m',
'skipped': '\033[{0}m'.format(codeCodes[C.COLOR_SKIP]),
'skipped': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_SKIP]),
}

View file

@ -98,15 +98,10 @@ def load_collection_meta(collection_pkg, no_version='*'):
if os.path.exists(manifest_path):
return load_collection_meta_manifest(manifest_path)
# Try to load galaxy.y(a)ml
# Try to load galaxy.yml
galaxy_path = os.path.join(path, 'galaxy.yml')
galaxy_alt_path = os.path.join(path, 'galaxy.yaml')
# galaxy.yaml was only supported in ansible-base 2.10 and ansible-core 2.11. Support was removed
# in https://github.com/ansible/ansible/commit/595413d11346b6f26bb3d9df2d8e05f2747508a3 for
# ansible-core 2.12.
for path in (galaxy_path, galaxy_alt_path):
if os.path.exists(path):
return load_collection_meta_galaxy(path, no_version=no_version)
if os.path.exists(galaxy_path):
return load_collection_meta_galaxy(galaxy_path, no_version=no_version)
return {}

View file

@ -10,13 +10,4 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.six import raise_from
try:
from ansible.module_utils.compat.version import LooseVersion # noqa: F401, pylint: disable=unused-import
except ImportError:
try:
from distutils.version import LooseVersion # noqa: F401, pylint: disable=unused-import
except ImportError as exc:
msg = 'To use this plugin or module with ansible-core 2.11, you need to use Python < 3.12 with distutils.version present'
raise_from(ImportError(msg), exc)