ansible-nginx/doc/auth.md

42 lines
919 B
Markdown
Raw Permalink Normal View History

2016-01-12 18:14:36 +07:00
Auth Basic management
=====================
Description
-----------
Auth basic is managed in a separate list. Each auth file can be shared between locations or sites.
2016-01-12 18:14:36 +07:00
Each htpasswd has few keys:
- `name`: (M) used to create file and as pointee
- `description`: (M) Used for the message box :)
2016-03-15 01:27:51 +07:00
- `users`: each users is composed with 3 keys: `name` (M), `password` (M) and `state` (O) present/absent (default: present)
2016-01-12 18:14:36 +07:00
- `state`: (O) present or absent. Default: present
2016-03-15 01:27:51 +07:00
`nginx_htpasswd` should be placed in a vault file.
2016-01-12 18:14:36 +07:00
2016-01-12 20:48:53 +07:00
Example
2016-01-12 18:14:36 +07:00
-------
2016-03-15 01:27:51 +07:00
```yaml
nginx_sites:
# htpasswd on all site
2016-01-12 18:14:36 +07:00
- name: test.local
2016-03-09 17:20:19 +07:00
htpasswd: 'hello'
2016-01-12 18:14:36 +07:00
template: '_base'
# htpasswd only in /hello
- name: test-location.local
template: '_base'
location:
'/hello':
2016-03-09 17:20:19 +07:00
- htpasswd: 'hello'
2016-01-12 18:14:36 +07:00
nginx_htpasswd:
- name: 'hello'
description: 'Please login!'
users:
- name: 'bob'
password: 'my_pass'
```