lib/gaptool-client.rb in gaptool-client-0.6.7 vs lib/gaptool-client.rb in gaptool-client-0.6.8

- old
+ new

@@ -101,12 +101,14 @@ option ["-t", "--type"], "TYPE", "Type of instance, e.g. m1.large", :required => true option ["-s", "--security-group"], "SECURITY_GROUP", "Security group name. Defaults to $role-$environment", required: false option ['-a', '--ami'], "AMI_ID", "Use a specific AMI for the instance (i.e. ami-xxxxxxx)", :required => false option ["-C", "--chef-repo"], "GITURL", "git url for the chef repository", :requireds => false option ["-b", "--chef-branch"], "BRANCH", "branch of the chef repository to use", :required => false + option ['-R', "--chef_runlist"], 'RECIPE|ROLE', 'override chef run_list. recipe[cb::recipe] or role[myrole]. Can be specified multiple times', :multivalued => true, :attribute_name => 'chef_runlist' def execute - $api.addnode(zone, type, role, environment, nil, security_group, ami, chef_repo, chef_branch) + $api.addnode(zone, type, role, environment, nil, + security_group, ami, chef_repo, chef_branch, chef_runlist) end end class TerminateCommand < Clamp::Command option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => true @@ -231,10 +233,10 @@ json = { 'this_server' => "#{role}-#{environment}-#{node['instance']}", 'role' => role, 'environment' => environment, 'app_user' => node['appuser'], - 'run_list' => [ "recipe[main]" ], + 'run_list' => node['chef_runlist'].nil? ? ['recipe[main]'] : eval(node['chef_run_list']), 'hostname' => node['hostname'], 'instance' => node['instance'], 'zone' => node['zone'], 'itype' => node['itype'], 'apps' => eval(node['apps']),