l3d.ansile_version
Check Ansible Version
What does it do?
This role checks the version of the Ansible playbook. If the version is too old, it will fail. This helps avoid problems that can arise from using outdated Ansible installations.
How to use it?
Run this Ansible role on localhost
.
Example playbook:
Using Ansible Galaxy:
# Install the role
ansible-galaxy install do1jlr.ansible_version
Example playbook:
---
- hosts: localhost
roles:
- {role: do1jlr.ansible_version, tags: [version, always], gather_facts: false}
Without Ansible Galaxy:
Clone the role to your roles directory as ansible_version
. Example:
git clone https://github.com/roles-ansible/ansible_role_versioncheck.git roles/ansible_version
Your playbook might look like this:
---
- name: Check if Ansible is not too old
hosts: localhost
tags:
- default
- version
- always
roles:
- ansible_version
gather_facts: false
Modifications
For changes or customizations, check the default
folder.
Participation
This role is developed on GitHub. Feel free to add issues or pull requests there. Thank you! <3
Testing
This role is tested with GitHub Actions for various versions of Debian and Ubuntu. The linting is tested through Travis CI and the official Ansible GitHub action. For more details on the tests, check the GitHub Marketplace.
Make sure you are only executing ansible with at least a specific ansible version.
ansible-galaxy install l3d.ansile_version