Chef cookbook to manage/install htpasswd
Ruby Python
Latest commit 1201e03 Sep 24, 2017 @akadoya akadoya committed with guilhem support for 'plaintext' type (#32)
support for plaintext
Permalink
Failed to load latest commit information.
attributes Update testing (#25) Apr 16, 2017
files/default first commit Mar 28, 2012
libraries Add new line! Jun 17, 2014
providers support for 'plaintext' type (#32) Sep 24, 2017
recipes use gem from chef 12.8 May 21, 2017
resources
test support for 'plaintext' type (#32) Sep 24, 2017
.gitignore Cleanup install part. Mar 11, 2014
.kitchen.yml Change tests and add deploy step May 21, 2017
.rubocop.yml
.travis.yml Fix travis deploy May 21, 2017
Berksfile
Gemfile
LICENSE Fix FC069, FC071, FC078 Apr 19, 2017
README.md support for 'plaintext' type (#32) Sep 24, 2017
Thorfile Fix rubocop Mar 14, 2014
chefignore Berkshelf support Jul 18, 2013
metadata.rb fix dpl with gem command May 21, 2017
supermarket.pem.enc Change tests and add deploy step May 21, 2017

README.md

htpasswd Build Status Cookbook Version

Description

Manage an htpasswd file. If htpasswd exe isn't found, we install a python implementation.

Requirements

Work on linux with python for build-in implementation

Resource/Provider

This cookbook includes LWRPs for managing:

  • htpasswd

htpasswd

Actions

  • :add: Add a login in a htpasswd file. modify it if there is already one and create file if not found (default)
  • :overwrite: Overwrite an htpasswd file (delete file and add user).

Attribute Parameters

  • package_name: file attribute. path of the htpaswwd to manage
  • user: user to create
  • password: password for the user

Example

# add user "foo" with password "bar" to "/etc/nginx/htpassword" with the default md5 type.
htpasswd "/etc/nginx/htpassword" do
  user "foo"
  password "bar"
end

# add user "foo" with password "bar" using sha1 as the type.
htpasswd "/etc/nginx/htpassword" do
  user "foo"
  password "bar"
  type "sha1"
end

# add user "foo" with encrypted password using plaintext as the type.
htpasswd "/etc/nginx/htpassword" do
  user "foo"
  password "$apr1$H5Z8CUB.$L3wyxUF1ZDd.oZFlTkJ4X."
  type "plaintext"
end