basic auth: remove support for Ubuntu <= 18.04.

This commit is contained in:
Andrea Dell'Amico 2025-11-27 01:33:57 +01:00
parent 979c9060df
commit 6f974e5560
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 20 additions and 17 deletions

View File

@ -1,25 +1,28 @@
---
- block:
- name: Install the python passlib library on deb based distributions
apt: pkg=python-passlib state=present cache_valid_time=3600
when:
- ansible_distribution_file_variety == "Debian"
- ansible_distribution_version is version_compare('18.04', '<=')
- name: Install the python passlib library on deb based distributions
- name: basic-auth | Manage the basic auth username and password on deb systems
when:
- ansible_distribution_file_variety == "Debian"
- ansible_distribution_version is version_compare('18.04', '>=')
- nginx_basic_auth
tags: nginx
block:
- name: basic-auth |Install the python passlib library on deb based distributions
apt: pkg=python3-passlib state=present cache_valid_time=3600
when:
- ansible_distribution_file_variety == "Debian"
- ansible_distribution_version is version_compare('18.04', '>=')
- name: Install the python passlib library on RH based distributions
yum: pkg=python-passlib state=present
when: ansible_distribution_file_variety == "RedHat"
- name: Create the htpasswd file needed by the basic auth
- name: basic-auth |Create the htpasswd file needed by the basic auth
htpasswd: path={{ item.file | default ('/etc/nginx/htpasswd') }} name={{ item.name }} password={{ item.pwd }} state={{ item.state | default('present') }} crypt_scheme={{ item.crypt | default('sha256_crypt') }}
with_items: '{{ nginx_basic_auth_users }}'
when: nginx_basic_auth
- name: basic-auth | Manage the basic auth username and password on EL systems
when:
- ansible_distribution_file_variety == "RedHat"
- nginx_basic_auth
tags: nginx
block:
- name: basic-auth |Install the python passlib library on RH based distributions
yum: pkg=python-passlib state=present
- name: basic-auth |Create the htpasswd file needed by the basic auth
htpasswd: path={{ item.file | default ('/etc/nginx/htpasswd') }} name={{ item.name }} password={{ item.pwd }} state={{ item.state | default('present') }} crypt_scheme={{ item.crypt | default('sha256_crypt') }}
with_items: '{{ nginx_basic_auth_users }}'