Skip to content

Instantly share code, notes, and snippets.

@vinyar
Created February 4, 2015 14:36
Show Gist options
  • Save vinyar/8439c5895ec864d97741 to your computer and use it in GitHub Desktop.
Save vinyar/8439c5895ec864d97741 to your computer and use it in GitHub Desktop.
chef file resource with laze attribute evaluation
file File.join(tmp_infra_dir, 'knife.rb') do
content lazy {
<<-EOH
node_name 'james'
chef_server_url '#{chef_server_url}'
client_key '#{tmp_infra_dir}/james.pem'
cookbook_path '#{Chef::Config[:cookbook_path]}'
trusted_certs_dir '#{Chef::Config[:trusted_certs_dir]}'
EOH
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment