Plugin Example
clburlison opened this issue · comments
Clayton Burlison commented
Is there any chance someone can upload a plugin sample? This repo is just different enough from chefctl that I'm configuring something incorrectly.
This is what I'm attempting to add as a plugin.
module TasteTesterCustom
def test_remote_client_rb_extra_code(_hostname)
# Append to client.rb
return "json_attribs '/etc/chef/run-list.json'"
end
end
TasteTester::Hooks.register TasteTesterCustom
Thanks!
Clayton Burlison commented
I ended up figuring it out.
Hooks.class_eval do
def self.test_remote_client_rb_extra_code(_hostname)
%(
json_attribs '/etc/chef/run-list.json'
node_name '#{serial}'
)
end
end