lib/gaptool-api.rb in gaptool-api-0.6.3 vs lib/gaptool-api.rb in gaptool-api-0.6.4
- old
+ new
@@ -31,11 +31,12 @@
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, chef_runlist=nil)
+ ami=nil, chef_repo=nil, chef_branch=nil, chef_runlist=nil,
+ no_terminate=nil)
@body = {
'zone' => zone || @default_aws_az,
'itype' => itype,
'role' => role,
'environment' => environment,
@@ -46,9 +47,12 @@
unless security_group.nil?
@body['security_group'] = security_group
end
unless chef_runlist.nil? || chef_runlist.empty?
@body['chef_runlist'] = [*chef_runlist]
+ end
+ if no_terminate
+ @body['terminate'] = false
end
@body = @body.to_json
options = { :body => @body, :headers => @auth}
JSON::parse self.class.post("/init", options)
end