Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: drop support for ansible-core 2.11 and 2.12 #157

Merged
merged 4 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/cookiecutter-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_context:
github_username: "JonasPammer"

galaxy_name: "jonaspammer"
min_ansible_version: "2.11"
min_ansible_version: "2.13"
allow_duplicates: "no"
ansible_user_needs_to_become: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: set up python 3
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: "3.x"
python-version: "3.10"

- name: setup/activate pre-commit cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],

"galaxy_name": "jonaspammer",
"min_ansible_version": "2.11",
"min_ansible_version": "2.13",
"allow_duplicates": "no",
"ansible_user_needs_to_become": true,
"use_renovate": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.9"
"version": "3.12"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
14 changes: 7 additions & 7 deletions {{ cookiecutter.project_slug }}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ name: CI (Lint + Molecule)
description: "Select Ansible Versions to run"
required: false
type: choice
# (minimum)
default: "ansible-6"
options:
- ansible-4,ansible-5,ansible-6,ansible-7,ansible-8
- ansible-4,ansible-5,ansible-6
- ansible-7,ansible-8
- ansible-4
- ansible-5
- ansible-6,ansible-7,ansible-8,ansible-9
- ansible-7,ansible-8,ansible-9
- ansible-8,ansible-9
- ansible-6
- ansible-7
- ansible-8
- ansible-9
pull_request:
branches-ignore:
- renovate/**
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: set up python 3
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Install yamllint package.
run: pip3 install "yamllint==1.*"
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: set up python 3
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: setup/activate pre-commit cache
uses: actions/cache@v3
Expand Down
11 changes: 4 additions & 7 deletions {{ cookiecutter.project_slug }}/DEVELOPMENT.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[development-system-dependencies]]
=== 📌 Development Machine Dependencies

* Python 3.9 or greater
* Python 3.10 or greater
* Docker

[[development-dependencies]]
Expand Down Expand Up @@ -74,19 +74,19 @@ take a look at the matrix defined in link:.github/workflows/ci.yml[].
$ *MOLECULE_DESTROY=never MOLECULE_DISTRO=#ubuntu1604# tox -e py3-ansible-#5#*
...
TASK [ansible-role-pip : (redacted).] pass:[************************]
failed: [instance-py3-ansible-5] => changed=false
failed: [instance-py3-ansible-9] => changed=false
...
pass:[___________________________________ summary ____________________________________]
pre-commit: commands succeeded
ERROR: py3-ansible-5: commands failed
ERROR: py3-ansible-9: commands failed
----

2. Find out the name of the molecule-provisioned docker container:
+
[subs="quotes"]
----
$ *docker ps*
#30e9b8d59cdf# geerlingguy/docker-debian10-ansible:latest "/lib/systemd/systemd" 8 minutes ago Up 8 minutes instance-py3-ansible-5
#30e9b8d59cdf# geerlingguy/docker-debian10-ansible:latest "/lib/systemd/systemd" 8 minutes ago Up 8 minutes instance-py3-ansible-9
----

3. Get into a bash Shell of the container, and do your debugging:
Expand All @@ -96,9 +96,6 @@ $ *docker ps*
$ *docker exec -it #30e9b8d59cdf# /bin/bash*

root@instance-py3-ansible-2:/#
root@instance-py3-ansible-2:/# python3 --version
Python 3.8.10
root@instance-py3-ansible-2:/# ...
----
+
[TIP]
Expand Down
3 changes: 1 addition & 2 deletions {{ cookiecutter.project_slug }}/README.orig.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,10 @@ https://github.com/ansible-collections/community.general#tested-with-ansible[
support pattern of Ansible's `community.general` collection].
As of writing this is:

* 2.11 (Ansible 4)
* 2.12 (Ansible 5)
* 2.13 (Ansible 6)
* 2.14 (Ansible 7)
* 2.15 (Ansible 8)
* 2.16 (Ansible 9)


[[development]]
Expand Down
19 changes: 7 additions & 12 deletions {{ cookiecutter.project_slug }}/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,23 @@ extend-ignore = E203
### Ansible Testing through Molecule ###
[tox]
minversion = 4.1.2
envlist = pre-commit,py{3}-ansible-{4,5,6,7,8}
envlist = pre-commit,py{3}-ansible-{6,7,8,9}

skipsdist = true

[testenv]
passenv = *
parallel_show_output = True
deps =
# For information on what included in the the "ansible" package,
# see https://github.com/ansible-community/ansible-build-data/blob/main/ (e.g. `/5/ansible-5.build`).
ansible-4: ansible == 4.* # core 2.11
ansible-5: ansible == 5.* # core 2.12
# For information on what included in the the "ansible" package, see
# https://github.com/ansible-community/ansible-build-data/blob/main/ (e.g. `/9/ansible-9.build`).
ansible-6: ansible == 6.* # core 2.13
ansible-7: ansible == 7.* # core 2.14
ansible-8: ansible == 8.* # core 2.15
ansible-4: molecule == 4.*
ansible-!4: molecule >= 5 # molecule v5.0.0 requires ansible-core>=2.12
ansible-4: molecule-plugins[docker] == 22.*
ansible-!4: molecule-plugins[docker] >= 23 # molecule-plugins v23.4.0 requires ansible-core>=2.12
ansible-9: ansible == 9.* # core 2.16
molecule == 6.*
molecule-plugins[docker] == 23.*
ansible-lint == 6.*
paramiko == 3.*
ansible-4: ansible-lint == 5.*
ansible-!4: ansible-lint >= 6 # ansible-lint 6 made ansible 2.12+ a direct dependency
commands =
ansible --version
molecule destroy
Expand Down
Loading