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

Bump ansible-core from 2.16.6 to 2.17.2 in /.github/workflows/requirements #444

Closed
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core==2.16.6
ansible-core==2.17.2
ansible-compat==24.7.0
yamllint==1.35.1
ansible-lint==24.7.0
2 changes: 1 addition & 1 deletion .github/workflows/requirements/requirements_galaxy.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ansible-core==2.16.6
ansible-core==2.17.2
jinja2==3.1.4
2 changes: 1 addition & 1 deletion .github/workflows/requirements/requirements_molecule.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core==2.16.6
ansible-core==2.17.2
jinja2==3.1.4
ansible-compat==24.7.0
molecule==24.7.0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

FEATURES:

- Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed.
- Bump the Ansible `community.general` collection to `9.2.0`, `community.crypto` collection to `2.21.1` and `community.docker` collection to `3.11.0`.

BUG FIXES:
Expand Down
45 changes: 45 additions & 0 deletions tasks/validate/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
- name: Verify you are using a supported Ansible version on your Ansible host
ansible.builtin.assert:
that: ansible_version['full'] is version(nginx_config_ansible_version, '>=')
success_msg: Ansible {{ ansible_version['full'] }} is supported.
fail_msg: Ansible {{ ansible_version['full'] }} has reached End of Life (EoL). Please upgrade to a supported Ansible release. Check the README for more details.
delegate_to: localhost
ignore_errors: true # noqa ignore-errors

- name: Extract the version of Jinja2 installed on your Ansible host
ansible.builtin.command: ansible --version
register: jinja2_version
changed_when: false
delegate_to: localhost
become: false

- name: Verify that you are using a supported Jinja2 version on your Ansible host
ansible.builtin.assert:
that: (jinja2_version['stdout'] | regex_search('jinja version = ([\\d.]+)', '\\1') | first) is version(nginx_config_jinja2_version, '>=')
success_msg: Jinja2 {{ jinja2_version['stdout'] | regex_search('jinja version = ([\d.]+)', '\1') | first }} is supported.
fail_msg: Jinja2 {{ jinja2_version['stdout'] | regex_search('jinja version = ([\d.]+)', '\1') | first }} is not supported. Please upgrade to Jinja2 3.1. Check the README for more details.
delegate_to: localhost
become: false

- name: Verify that the 'community.general' and 'ansible.posix' Ansible collections are installed on your Ansible host
when: nginx_config_selinux | bool
delegate_to: localhost
become: false
block:
- name: Extract the list of Ansible collections installed on your Ansible host
ansible.builtin.command: ansible-galaxy collection list
register: collection_list
changed_when: false

- name: Verify that the 'community.general' Ansible collection is installed on your Ansible host
ansible.builtin.assert:
that: collection_list is search('community.general')
success_msg: The 'community.general' Ansible collection is installed.
fail_msg: The 'community.general' Ansible collection is not installed. Please install the 'community.general' Ansible collection. Check the README for more details.

- name: Verify that the 'ansible.posix' Ansible collection is installed on your Ansible host
ansible.builtin.assert:
that: lookup('community.general.collection_version', 'ansible.posix') != 'none'
success_msg: The 'ansible.posix' Ansible collection is installed.
fail_msg: The 'ansible.posix' Ansible collection is not installed. Please install the 'ansible.posix' Ansible collection. Check the README for more details.
3 changes: 3 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
---
# Set the minimum version required for Ansible and Jinja2
nginx_config_ansible_version: 2.16
nginx_config_jinja2_version: 3.1
Loading