Adding SNS Handler to Client


#1

I’m trying to use the chef client cookbook to install the chef sns handler.
The docs are pretty clear. I have this in an environment:

“default_attributes”: {
“chef-client”: {
“load_gems”: {
“chef-handler-updated-resources”: {
“require_name”: “chef/handler/sns”
}
},
“config”: {
“chef_server_url”: “https://chef-004.dev.slicetest.com
}
}
}

On my client system, the /etc/chef/client.rb file ends up with:

chef_server_url "https://chef-004.dev.slicetest.com:443"
log_location '/var/log/chef/client.log’
validation_client_name "chef-validator"
verify_api_cert true

Using default node name (fqdn)

Ohai::Config[:plugin_path] << “/etc/chef/ohai_plugins”

Dir.glob(File.join("/etc/chef", “client.d”, “*.rb”)).each do |conf|
Chef::Config.from_file(conf)
end

However, the docs say that the following should be added to /etc/client.rb:

[“chef/handler/updated_resources”].each do |lib|
begin
require lib
rescue LoadError
Chef::Log.warn "Failed to load #{lib}. This should be resolved after a
chef run."
end
end

This is not added. I’m using the latest version of the chef client
cookbook. Why is it not being added?


Regards,
Douglas Garstang