Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Last active July 25, 2021 05:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamhjk/6141718 to your computer and use it in GitHub Desktop.
Save adamhjk/6141718 to your computer and use it in GitHub Desktop.
Prove that Chef Solo works just fine with default attributes. Output of chef-solo -c solo.rb -j test.json:

Proves that default attributes work fine in Chef Solo:

chef-solo -c solo.rb -j test.json

  /t/w/solo-def ❯❯❯ chef-solo -c solo.rb -j test.json
  Starting Chef Client, version 11.4.4
  Compiling Cookbooks...
  [2013-08-02T10:30:01-07:00] WARN: I see that solo works... fine
  Converging 1 resources
  Recipe: solo-def::default
    * file[/tmp/what] action create (up to date)  
  Chef Client finished, 0 resources updated
  /t/w/solo-def ❯❯❯ cat /tmp/what
  fine%
default['solo']['works'] = "fine"
Chef::Log.warn "I see that solo works... #{node['solo']['works']}"
file "/tmp/what" do
content node['solo']['works']
end
file_cache_path File.join(File.expand_path(File.dirname(__FILE__), "cache"))
cookbook_path File.expand_path(File.join(File.dirname(__FILE__), ".."))
{
"run_list": [ "recipe[solo-def]" ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment