prometheus/tasks/asserts.yml
2022-11-11 21:08:07 +01:00

37 lines
981 B
YAML

---
- name: 'assert | check if ansible version >= 2.7'
assert:
that: ansible_version.full is version_compare(2.7, '>=')
msg: Ansible version 2.7 or later is required to use this version of the role
tags:
- prometheus
- name: 'assert | gather the package facts'
ansible.builtin.package_facts:
manager: auto
when:
- prometheus_server_enable is defined
- prometheus_server_enable == "true"
tags:
- prometheus
- name: 'assert | check if docker-ce is installed'
assert:
that: "'docker-ce' in ansible_facts.packages"
when:
- prometheus_server_enable is defined
- prometheus_server_enable == "true"
tags:
- prometheus
- name: 'assert | check if docker pyhon libraries are installed'
assert:
that:
#- "'python-docker' in ansible_facts.packages"
- "'python3-docker' in ansible_facts.packages"
when:
- prometheus_server_enable is defined
- prometheus_server_enable == "true"
tags:
- prometheus