facebook / taste-tester

Software to manage a chef-zero instance and use it to test changes on production servers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin Example

clburlison opened this issue · comments

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!

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