Module: ChefHelpers
- Defined in:
- lib/chef_helpers.rb,
lib/chef_helpers/version.rb,
lib/chef_helpers/exceptions.rb
Overview
rubocop:disable Style/Documentation
Defined Under Namespace
Modules: Exceptions
Constant Summary collapse
- VERSION =
'0.1.1'
Instance Method Summary collapse
-
#encrypt_password(password, hash_algo = :sha512) ⇒ String
Returns an encrypted, salted password hash for use in /etc/shadow and by the Chef user resource.
Instance Method Details
#encrypt_password(password, hash_algo = :sha512) ⇒ String
Returns an encrypted, salted password hash for use in /etc/shadow and by the Chef user resource.
23 24 25 26 27 |
# File 'lib/chef_helpers.rb', line 23 def encrypt_password(password, hash_algo = :sha512) build_password(password, hash_algo).tap do |pw| fail InvalidPasswordError unless UnixCrypt.valid?(password, pw) end end |