lib/gaptool-api.rb in gaptool-api-0.6.1 vs lib/gaptool-api.rb in gaptool-api-0.6.3
- old
+ new
@@ -30,11 +30,12 @@
def getenvroles(role, environment)
options = {:headers => @auth}
JSON::parse self.class.get("/hosts/#{role}/#{environment}", options)
end
- def addnode(zone, itype, role, environment, mirror=nil, security_group=nil, ami=nil, chef_repo=nil, chef_branch=nil)
+ def addnode(zone, itype, role, environment, mirror=nil, security_group=nil,
+ ami=nil, chef_repo=nil, chef_branch=nil, chef_runlist=nil)
@body = {
'zone' => zone || @default_aws_az,
'itype' => itype,
'role' => role,
'environment' => environment,
@@ -42,9 +43,12 @@
'chef_repo' => chef_repo,
'chef_branch' => chef_branch
}
unless security_group.nil?
@body['security_group'] = security_group
+ end
+ unless chef_runlist.nil? || chef_runlist.empty?
+ @body['chef_runlist'] = [*chef_runlist]
end
@body = @body.to_json
options = { :body => @body, :headers => @auth}
JSON::parse self.class.post("/init", options)
end