class Chef::Knife::HitoriPrepare

Attributes

server[R]

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/hitori_prepare.rb, line 21
def run
  update_environment(config[:environment]) if config[:environment]
  conf = ask_ec2_config_all(Chef::Config.knife, true)
  ec2 = setup_knife_ec2(conf)
  ec2.run
  @server = ec2.server
end
setup_knife_ec2(conf) click to toggle source
# File lib/chef/knife/hitori_prepare.rb, line 29
def setup_knife_ec2(conf)
  Chef::Knife::Ec2ServerCreate.load_deps
  args = []
  args << '--groups=' + conf[:security_groups]
  args << '--availability-zone=' + conf[:availability_zone]
  args << '--image=' + conf[:image]
  args << '--flavor=' + conf[:flavor]

  args << '--ssh-user=' + conf[:ssh_user]
  args << '--ssh-port=' + conf[:ssh_port].to_s
  args << '--identity-file=' + conf[:identity_file]
  args << '--ssh-key=' + conf[:aws_ssh_key_id]
  args << '--region=' + conf[:region]
  args << '--template-file=' + conf[:template_file]
  ui.info args.join(' ')
  Chef::Knife::Ec2ServerCreate.new(args)
end