Skip to content

Instantly share code, notes, and snippets.

@erichelgeson
Last active August 29, 2015 14:01
Show Gist options
  • Save erichelgeson/a46b615aabf33cde2ff7 to your computer and use it in GitHub Desktop.
Save erichelgeson/a46b615aabf33cde2ff7 to your computer and use it in GitHub Desktop.
key = '/home/vagrant/.ssh/id_rsa'
bash "generate_key" do
user "vagrant"
code <<-EOH
ssh-keygen -f #{key} -t rsa -N ''
EOH
not_if { ::File.exists?(key) }
end
ruby_block "reload_config" do
block do
node.default['test'] = IO.read(key)
node.save
end
action :create
end
log "#{node['test']}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment