Information Technology Reference
In-Depth Information
more node.debug_value() calls in our code. Change recipes/default.rb as shown in
Example 8-11 , adding a call to node.debug_value('motd-attributes', 'message') be-
fore and after include_recipe .
Example 8-11. chefdk/motd-attributes/recipes/default.rb
#
# Cookbook Name:: motd-attributes
# Recipe:: default
#
# Copyright (C) 2014
#
#
#
require 'pp'
node . default [ 'ipaddress' ] = '1.1.1.1'
pp node . debug_value ( 'ipaddress' )
node . default [ 'motd-attributes' ][ 'company' ] = 'My Company'
node . default [ 'motd-attributes' ][ 'message' ] = "It's a wonderful day today!"
pp node . debug_value ( 'motd-attributes' , 'company' )
include_recipe 'motd-attributes::message'
pp node . debug_value ( 'motd-attributes' , 'company' )
template '/etc/motd' ddo
source 'motd.erb'
mode '0644'
end
end
Run kitchen converge again, and the output of node.debug_value() should resemble the
output shown in Figure 8-7 , with the second-to-last dump of node.debug_value() being be-
fore include_recipe and the last being after include_recipe .
Search WWH ::




Custom Search