Skip to content

Instantly share code, notes, and snippets.

View kakwa's full-sized avatar

Carpentier Pierre-Francois kakwa

View GitHub Profile
@kakwa
kakwa / 0_pw_hash.rb
Last active August 29, 2015 14:10 — forked from pschyska/0_pw_hash.rb
patched version of pw_hash.rb working with puppetserver and jruby
require 'puppet/parser/functions'
module Puppet::Parser::Functions
newfunction(:pw_hash, :type => :rvalue, :doc => "Returns the hash of a password."
) do |args|
raise Puppet::ParseError, "pw_hash takes exactly two arguments," +
"#{args.length} provided" if args.length != 2
pwd = args[0]
slt = args[1]