evolinux-base and admin-users are only compatible Debian >=8, declare once in main.yml and that's all

(will be probably generalized to others modules if needed)
This commit is contained in:
Gregory Colpart 2017-08-22 00:42:14 +02:00
parent 606f3a14f5
commit 5226082db0
6 changed files with 15 additions and 6 deletions

View file

@ -12,6 +12,7 @@ galaxy_info:
- name: Debian
versions:
- jessie
- stretch
dependencies: []
# List your role dependencies here, one per line.

View file

@ -1,5 +1,11 @@
---
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('8', '<')
- debug:
msg: "Warning: empty 'admin_users' variable, tasks will be skipped!"
when: admin_users == {}

View file

@ -21,7 +21,6 @@
replace: '\1,{{ user.name }}'
validate: '/usr/sbin/visudo -cf %s'
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- not copy_sudoers_evolinux.changed

View file

@ -1,4 +1,11 @@
---
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('8', '<')
- name: Hostname
include: hostname.yml
when: evolinux_hostname_include

View file

@ -79,7 +79,6 @@
- net-tools
when:
- evolinux_packages_stretch
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('9', '>=')
- name: Customize logcheck recipient
@ -111,7 +110,6 @@
- { option: "which", value: "both" }
when:
- evolinux_packages_listchanges
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- meta: flush_handlers

View file

@ -75,8 +75,6 @@
regexp: '^#?LogLevel [A-Z]+'
replace: "LogLevel VERBOSE"
notify: reload sshd
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('9', '>=')
when: ansible_distribution_major_version | version_compare('9', '>=')
- meta: flush_handlers