Skip to content

alexhelkar/ansible-htpasswd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible franklinkim.htpasswd role

Build Status Galaxy GitHub Tags GitHub Stars

franklinkim.htpasswd is an Ansible role which:

  • installs htpasswd
  • manages htpasswd files

Installation

Using ansible-galaxy:

$ ansible-galaxy install franklinkim.htpasswd

Using requirements.yml:

- src: franklinkim.htpasswd

Using git:

$ git clone https://github.com/weareinteractive/ansible-htpasswd.git franklinkim.htpasswd

Dependencies

  • Ansible >= 1.9

Variables

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

Usage

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

Testing

$ git clone https://github.com/weareinteractive/ansible-htpasswd.git
$ cd ansible-htpasswd
$ vagrant up

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Note: To update the README.md file please install and run ansible-role:

$ gem install ansible-role
$ ansible-role docgen

License

Copyright (c) We Are Interactive under the MIT license.

About

Ansible role which installs htpasswd and creates files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%