htpasswd
Collection: community.general
Full Name: parallax.community.general.htpasswd
Aliases: community.general.htpasswd, htpasswd
Synopsis
Manage user entries in an Apache htpasswd file
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| path | string | yes | Path to the htpasswd file | |
| name | string | yes | User name to add or remove | |
| password | string | Password associated with the user (required if state is present) | ||
| crypt_scheme | string | apr_md5_crypt | Encryption scheme to use Choices: apr_md5_crypt, plaintext, sha1 | |
| state | string | present | Whether the user entry should be present or absent Choices: present, absent | |
| create | bool | true | Create the htpasswd file if it does not exist |
Example
- name: Add a user to the metrics htpasswd file
htpasswd:
path: /etc/nginx/metrics.htpasswd
name: prometheus
password: "{{ metrics_password }}"
crypt_scheme: bcrypt
state: present