1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_versioncheck.git synced 2024-08-16 15:59:49 +02:00

Update versioncheck mechanism

This commit is contained in:
Lilian Roller 2020-01-23 13:18:13 +01:00
parent ad13d8b532
commit 3a46a61f06
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
2 changed files with 5 additions and 4 deletions

View file

@ -3,7 +3,7 @@ galaxy_info:
author: L3D author: L3D
description: Make sure you are only executing ansible with at least a specific ansible version. description: Make sure you are only executing ansible with at least a specific ansible version.
license: "MIT" license: "MIT"
min_ansible_version: 2.9 min_ansible_version: 2.7
github_branch: master github_branch: master
role_name: ansible_version role_name: ansible_version
platforms: platforms:

View file

@ -1,7 +1,8 @@
--- ---
- name: "check if ansible version is above {{ check_ansible_version }}" - name: "check if ansible version is above {{ check_ansible_version }}"
assert: assert:
that: "ansible_version.full is version_compare(check_ansible_version, '>=')" that:
msg: > - "ansible_version.full is version_compare(check_ansible_version, '>=')"
"You need at least ansible version {{ check_ansible_version }}. Current Version: {{ ansible_version.full }}" fail_msg: "[ERROR] You need at least ansible version {{ check_ansible_version }}. Current Version: {{ ansible_version.full }}"
success_msg: "Congratulations. You are using ansible version {{ ansible_version.full }}"
delegate_to: localhost delegate_to: localhost