-
-
Save yfeldblum/8c00897605b5d772117a to your computer and use it in GitHub Desktop.
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
secret_path = Pathname(node["my-recipe"]["secret"]["path"]) | |
if secret_path.exist? | |
secret = secret_path.read | |
else | |
secret = new_secret | |
secret_path.open{|f| f.write(secret)} | |
end |
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
secret_path = Pathname(node["my-recipe"]["secret"]["path"]) | |
if secret_path.exist? | |
secret = secret_path.read | |
else | |
# should never get here | |
raise StandardError, "secret path is missing" | |
end | |
template "/etc/my-app.conf" do | |
variables :secret => secret | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment