This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=16 | |
cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_ | head -c ${l} | |
echo | |
} | |
genpasswd "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO throwing error: | |
# Cannot find a resource for to_ary on ubuntu version 12.04 | |
require 'set' | |
file "/root/chef_resources-#{node.name}.json" do | |
resource_clxn = Chef::ResourceCollection.new | |
run_context.resource_collection.each do |r| | |
next if r.class.to_s == 'Chef::Resource::NodeMetadata' | |
r = r.dup |