Skip to content

Instantly share code, notes, and snippets.

@jmara
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmara/ff9fdcfa45c053fff688 to your computer and use it in GitHub Desktop.
Save jmara/ff9fdcfa45c053fff688 to your computer and use it in GitHub Desktop.
file "/opt/local-user.txt" do
action :create
owner "root"
group "root"
content "jmara"
mode 00644
end
if File.exist?("/opt/local-user.txt")
user = File.read("/opt/local-user.txt")
node.set["local_user"] = user
log "Current user: #{node['local_user']} -> #{user}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment