From 50e25d45b835a0e570ad1e6c8d55080adfc42c76 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 27 Jul 2017 11:50:48 +0200 Subject: [PATCH] Elegent fail for htpasswd+stretch (#28 related) --- .travis.yml | 4 ++-- Vagrantfile | 3 ++- doc/auth.md | 5 +++++ tasks/install_Debian.yml | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 850c785..b90c5ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,15 @@ env: - PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.2,<2.3' - PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.2,<2.3' - PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.2,<2.3' - - PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.2,<2.3' + - PLATFORM='docker-debian-stretch-noht' ANSIBLE_VERSION='ansible>=2.2,<2.3' - PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.3,<2.4' + - PLATFORM='docker-debian-stretch-noht' ANSIBLE_VERSION='ansible>=2.3,<2.4' matrix: allow_failures: - - env: PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.2,<2.3' - env: PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.3,<2.4' fast_finish: true diff --git a/Vagrantfile b/Vagrantfile index 2a7ce55..5809187 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,8 @@ Vagrant.configure("2") do |config| { :name => "debian-jessie", :box => "debian/jessie64", :vars => { "nginx_php56": true, "nginx_php70": false, "dotdeb": false, "nginx_backports": false }}, { :name => "debian-jessie-backports", :box => "debian/jessie64", :vars => { "nginx_php56": true, "nginx_php70": false, "dotdeb": false, "nginx_backports": true }}, { :name => "debian-jessie-dotdeb", :box => "debian/jessie64", :vars => { "nginx_php56": true, "nginx_php70": true, "dotdeb": true, "nginx_backports": false }}, - { :name => "debian-stretch", :box => "debian/stretch64", :vars => { "nginx_php56": false, "nginx_php70": true, "dotdeb": false, "nginx_backports": false }} + { :name => "debian-stretch", :box => "debian/stretch64", :vars => { "nginx_php56": false, "nginx_php70": true, "dotdeb": false, "nginx_backports": false }}, + { :name => "debian-stretch-noht", :box => "debian/stretch64", :vars => { "nginx_php56": false, "nginx_php70": true, "dotdeb": false, "nginx_backports": false, nginx_htpasswd: [] }} ] vms_freebsd = [ diff --git a/doc/auth.md b/doc/auth.md index 28bf962..f5caf0c 100644 --- a/doc/auth.md +++ b/doc/auth.md @@ -1,6 +1,11 @@ Auth Basic management ===================== +IMPORTANT +--------- + +If you use this feature with Debian Stretch, you *MUST* use ansible >= 2.3.2! See: [https://github.com/HanXHX/ansible-nginx/issues/28](#28). + Description ----------- diff --git a/tasks/install_Debian.yml b/tasks/install_Debian.yml index 0f80d82..6360234 100644 --- a/tasks/install_Debian.yml +++ b/tasks/install_Debian.yml @@ -1,5 +1,13 @@ --- +- name: FAIL | Check possible issues + fail: + msg: "This ansible version ({{ ansible_version.full}}) is not compatible with your needs (Debian Stretch + htpasswd). Please see https://github.com/HanXHX/ansible-nginx/issues/28" + when: + ansible_distribution_major_version >= 9 and + ansible_version.full | version_compare('2.3.2', 'lt') and + nginx_htpasswd | length > 0 + - name: APT | Update cache apt: > update_cache=yes