Skip to content

Instantly share code, notes, and snippets.

@fh
Last active March 28, 2019 14:00
Show Gist options
  • Save fh/6069112 to your computer and use it in GitHub Desktop.
Save fh/6069112 to your computer and use it in GitHub Desktop.
Generating a Yaml Config file with Chef
<%= @content %>
"config_content": {
"somestuff": {
"foo": "bar",
"bla": "batz"
}
}
require "yaml"
template "/some/path/to/file.yml" do
mode 0644
variables :content => YAML::dump(YAML::dump(config_content.to_hash).gsub('!map:Mash',''))
source "app.yml.erb"
end
@askz
Copy link

askz commented Mar 28, 2019

why not :
variables :content => config_content.to_hash.to_yaml
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment