2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Load the basic auth modules
|
|
|
|
apache2_module: name={{ item }} state=present
|
2016-09-05 16:40:57 +02:00
|
|
|
with_items: '{{ apache_basic_auth_modules }}'
|
2015-05-28 11:32:57 +02:00
|
|
|
notify: apache2 reload
|
|
|
|
tags:
|
|
|
|
- apache
|
|
|
|
- apache_basic_auth
|
|
|
|
|
|
|
|
- name: Create the authentication directory
|
|
|
|
file: path={{ apache_basic_auth_dir }} mode=0750 owner=root group={{ apache_group }} state=directory
|
|
|
|
tags:
|
|
|
|
- apache
|
|
|
|
- apache_basic_auth
|
|
|
|
|
|
|
|
- name: Install the python-passlib library
|
|
|
|
apt: pkg=python-passlib state=present
|
|
|
|
tags:
|
|
|
|
- apache
|
|
|
|
- apache_basic_auth
|
|
|
|
|
|
|
|
- name: Create the basic auth file
|
|
|
|
htpasswd: path={{ apache_basic_auth_file }} name={{ item.username }} password={{ item.password }} create=yes state={{ item.state }}
|
|
|
|
when: apache_basic_users is defined and apache_basic_auth_single_file
|
|
|
|
tags:
|
|
|
|
- apache
|
|
|
|
- apache_basic_auth
|
2015-10-02 11:33:10 +02:00
|
|
|
ignore_errors: True
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Create the basic auth file
|
|
|
|
htpasswd: path={{ item.auth_file }} name={{ item.username }} password={{ item.password }} create=yes state={{ item.state }}
|
2016-09-05 16:40:57 +02:00
|
|
|
with_items: '{{ apache_basic_users }}'
|
2015-05-28 11:32:57 +02:00
|
|
|
when: apache_basic_users is defined and not apache_basic_auth_single_file
|
|
|
|
tags:
|
|
|
|
- apache
|
|
|
|
- apache_basic_auth
|
2015-10-02 11:33:10 +02:00
|
|
|
ignore_errors: True
|
2015-05-28 11:32:57 +02:00
|
|
|
|