Created
January 20, 2016 21:03
-
-
Save hartmantis/d343bbc5f87ff56154e4 to your computer and use it in GitHub Desktop.
Chef array attributes
This file contains hidden or 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
default['arraytest'] = %w(thing1 thing2 thing3) |
This file contains hidden or 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
Chef::Log.warn("Inside the #{cookbook_name} default recipe, the attribute is #{node['arraytest']}") |
This file contains hidden or 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
default['arraytest'] = %w(thing4 thing5 thing6) |
This file contains hidden or 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
Chef::Log.warn("Inside the #{cookbook_name} default recipe, the attribute is #{node['arraytest']}") |
This file contains hidden or 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
include_recipe 'arraytest1' | |
include_recipe 'arraytest2' | |
Chef::Log.warn("Inside the #{cookbook_name} default recipe, the attribute is #{node['arraytest']}") | |
file '/etc/arraytest' do | |
content node['arraytest'].join("\n") | |
end |
This file contains hidden or 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
-----> Chef Omnibus installation detected (install only if missing) | |
Transferring files to <default-ubuntu-1404> | |
Starting Chef Client, version 12.6.0 | |
resolving cookbooks for run list: ["arraytest3::default"] | |
Synchronizing Cookbooks: | |
- arraytest1 (0.1.0) | |
- arraytest2 (0.1.0) | |
- arraytest3 (0.1.0) | |
Compiling Cookbooks... | |
[2016-01-20T20:59:53+00:00] WARN: Inside the arraytest1 default recipe, the attribute is ["thing4", "thing5", "thing6"] | |
[2016-01-20T20:59:53+00:00] WARN: Inside the arraytest2 default recipe, the attribute is ["thing4", "thing5", "thing6"] | |
[2016-01-20T20:59:53+00:00] WARN: Inside the arraytest3 default recipe, the attribute is ["thing4", "thing5", "thing6"] | |
Converging 1 resources | |
Recipe: arraytest3::default | |
* file[/etc/arraytest] action create | |
- create new file /etc/arraytest | |
- update content in file /etc/arraytest from none to fb79c9 | |
--- /etc/arraytest 2016-01-20 20:59:53.717401793 +0000 | |
+++ /etc/.arraytest20160120-1925-1lz5y4k 2016-01-20 20:59:53.717401793 +0000 | |
@@ -1 +1,4 @@ | |
+thing4 | |
+thing5 | |
+thing6 | |
Running handlers: | |
Running handlers complete | |
Chef Client finished, 1/1 resources updated in 01 seconds | |
Finished converging <default-ubuntu-1404> (0m3.36s). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment