Skip to content
Snippets Groups Projects
Commit b2dcfa08 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "host_os: Use assert on checks for readability"

parents 59002ded 50d44205
No related branches found
No related tags found
No related merge requests found
--- ---
- name: Checking host OS distribution - name: Checking host OS distribution
fail: assert:
msg: >- that: ansible_facts.distribution in host_os_distributions
fail_msg: >-
Host OS distribution {{ ansible_facts.distribution }} is not supported. Host OS distribution {{ ansible_facts.distribution }} is not supported.
Supported distributions are: {{ host_os_distributions.keys() | join(', ') }} Supported distributions are: {{ host_os_distributions.keys() | join(', ') }}
when: ansible_facts.distribution not in host_os_distributions
- name: Checking host OS release or version - name: Checking host OS release or version
fail: assert:
msg: >- that:
- ansible_facts.distribution_release in host_os_distributions[ansible_facts.distribution] or
ansible_facts.distribution_version in host_os_distributions[ansible_facts.distribution] or
ansible_facts.distribution_major_version in host_os_distributions[ansible_facts.distribution]
fail_msg: >-
{{ ansible_facts.distribution }} release {{ ansible_facts.distribution_release }} {{ ansible_facts.distribution }} release {{ ansible_facts.distribution_release }}
version {{ ansible_facts.distribution_version }} is not supported. version {{ ansible_facts.distribution_version }} is not supported.
Supported releases are: Supported releases are:
{{ host_os_distributions[ansible_facts.distribution] | join(', ') }} {{ host_os_distributions[ansible_facts.distribution] | join(', ') }}
when:
- ansible_facts.distribution_release not in host_os_distributions[ansible_facts.distribution]
- ansible_facts.distribution_version not in host_os_distributions[ansible_facts.distribution]
- ansible_facts.distribution_major_version not in host_os_distributions[ansible_facts.distribution]
- name: Checking if CentOS is Stream - name: Checking if CentOS is Stream
become: true become: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment