add possibility to manually set private ip to created instances

This commit is contained in:
Anton Chuchkalov 2016-01-13 14:02:32 +03:00
parent 3e9c24bbf2
commit 8b0b1f9e11
5 changed files with 9 additions and 4 deletions

View File

@ -71,7 +71,7 @@ class Server < Handler
:deploy_env => @args[3]
}
[:key, :without_bootstrap, :name, :groups, :force].each do |k|
[:key, :without_bootstrap, :name, :groups, :force, :private_ip].each do |k|
q[k] = self.options[k] unless self.options[k].nil?
end

View File

@ -122,6 +122,8 @@ class ServerOptions < CommonOptions
options[:groups] = groups.split(",")
end
parser.recognize_option_value(:private_ip, 'server', short: '-N', i18n_scope: 'create')
# it was disabled somewhy
# parser.on('--public-ip', "Associate public IP with server") do
# options[:public_ip] = true

View File

@ -360,11 +360,12 @@ en:
unreserve:
instance: Unreserve server by instance id
create:
without-bootstrap: 'Run server without bootsraping phase'
without_bootstrap: 'Run server without bootsraping phase'
name: Set node name
groups: The security groups for this server
force: Cancel rollback operation on error
key: User another key for server
private_ip: Private ip for this server
bootstrap:
name: Set chef name
bootstrap_template: Bootstrap template

View File

@ -82,7 +82,8 @@ module Devops
"deploy_env" => @deploy_env.identifier,
"created_by" => options["created_by"],
"provider" => @deploy_env.provider,
"provider_account" => @deploy_env.provider_account
"provider_account" => @deploy_env.provider_account,
"private_ip" => options["private_ip"]
})
end

View File

@ -99,7 +99,8 @@ module Provider
options = {
"InstanceType" => flavor,
# "Placement.AvailabilityZone" => s.options[:availability_zone],
"KeyName" => self.ssh_key
"KeyName" => self.ssh_key,
"PrivateIpAddress" => s.private_ip
}
vpcId = nil
unless subnets.empty?