franklinkim.htpasswdis an Ansible role which:
- installs
htpasswd- manages
htpasswdfiles
Using ansible-galaxy:
$ ansible-galaxy install franklinkim.htpasswdUsing requirements.yml:
- src: franklinkim.htpasswdUsing git:
$ git clone https://github.com/weareinteractive/ansible-htpasswd.git franklinkim.htpasswd- Ansible >= 1.9
Here is a list of all the default variables for this role, which are also available in defaults/main.yml.
---
#
# htpasswd:
# - name: myapp
# users:
# - { name: user1, password: secret1 }
# - name: otherapp
# path: /foo/bar
# users:
# - { name: user2, password: secret2, crypt: ldap_sha1 }
# list of entries
htpasswd: []
# path to auth files
htpasswd_path: /etc/htpasswd
# default crypt [apr_md5_crypt | des_crypt | ldap_sha1 | plaintext]
htpasswd_crypt: apr_md5_crypt
# auth files owner
htpasswd_owner: root
# auth files group
htpasswd_group: root
# auth files mode
htpasswd_mode: "0644"
# list of package to install, python-passlib is a pre-requisite for htpasswd ansible module
htpasswd_packages:
- python-passlib
- apache2-utils
This is an example playbook:
---
- hosts: all
sudo: yes
roles:
- franklinkim.htpasswd
vars:
htpasswd:
- name: myapp
users:
- { name: user1, password: secret1 }
- name: otherapp
path: /usr/local/etc
users:
- { name: user2, password: secret2 }
mode: "0600"
group: staff
$ git clone https://github.com/weareinteractive/ansible-htpasswd.git
$ cd ansible-htpasswd
$ vagrant upIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Note: To update the README.md file please install and run ansible-role:
$ gem install ansible-role
$ ansible-role docgenCopyright (c) We Are Interactive under the MIT license.