Information Technology Reference
In-Depth Information
tributes::default . We won't remove any of the attribute values we set earlier, in order to
illustrate a few more attribute priority concepts.
Example 8-9. chefdk/motd-attributes/recipes/default.rb
#
# Cookbook Name:: motd-attributes
# Recipe:: default
#
# Copyright (C) 2014
#
#
#
node . default [ 'ipaddress' ] = '1.1.1.1'
node . default [ 'motd-attributes' ][ 'company' ] = 'My Company'
node . default [ 'motd-attributes' ][ 'message' ] = "It's a wonderful day today!"
include_recipe 'motd-attributes::message'
template '/etc/motd' ddo
source 'motd.erb'
mode '0644'
end
end
include_recipe statements can be present anywhere in a recipe file. When the Chef code is
evaluated, the include_recipe statement is replaced with an expansion of the recipe code
that is referenced, as shown in Figure 8-5 .
Search WWH ::




Custom Search