forked from evolix/ansible-roles
Improve distribution verification
This commit is contained in:
parent
a5db321717
commit
207a2f6011
|
@ -3,8 +3,7 @@
|
||||||
- fail:
|
- fail:
|
||||||
msg: only compatible with Debian >= 8
|
msg: only compatible with Debian >= 8
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_major_version | version_compare('8', '<')
|
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "Warning: empty 'admin_users' variable, tasks will be skipped!"
|
msg: "Warning: empty 'admin_users' variable, tasks will be skipped!"
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Fail if distribution is not supported
|
- fail:
|
||||||
fail:
|
msg: only compatible with Debian >= 8
|
||||||
msg: "Error: '{{ ansible_os_family }} {{ ansible_distribution_release }}' is not a supported distribution."
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution_release != "jessie"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_release != "stretch"
|
|
||||||
tags:
|
tags:
|
||||||
- apt
|
- apt
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Fail if distribution is not supported
|
- fail:
|
||||||
fail:
|
msg: only compatible with Debian >= 8
|
||||||
msg: "Error: '{{ ansible_os_family }} {{ ansible_distribution_release }}' is not a supported distribution."
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution_release != "jessie"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_release != "stretch"
|
|
||||||
|
|
||||||
- include: certbot.yml
|
- include: certbot.yml
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
- fail:
|
- fail:
|
||||||
msg: only compatible with Debian >= 8
|
msg: only compatible with Debian >= 8
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_major_version | version_compare('8', '<')
|
|
||||||
|
|
||||||
- name: Hostname
|
- name: Hostname
|
||||||
include: hostname.yml
|
include: hostname.yml
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
- fail:
|
- fail:
|
||||||
msg: only compatible with Debian >= 8
|
msg: only compatible with Debian >= 8
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_major_version | version_compare('8', '<')
|
|
||||||
|
|
||||||
- include: php_jessie.yml
|
- include: php_jessie.yml
|
||||||
when: ansible_distribution_release == "jessie"
|
when: ansible_distribution_release == "jessie"
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
- fail:
|
- fail:
|
||||||
msg: only compatible with Debian >= 8
|
msg: only compatible with Debian >= 8
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
|
||||||
- ansible_distribution_major_version | version_compare('8', '<')
|
|
||||||
|
|
||||||
- name: "Set squid name (jessie)"
|
- name: "Set squid name (jessie)"
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
Loading…
Reference in a new issue