From acdfd233139c9bbb816702cee97e40baf7fbb18e Mon Sep 17 00:00:00 2001 From: Edward Middleton Date: Wed, 8 Jun 2011 16:53:19 +0900 Subject: [PATCH] pass dns information to instance --- lib/chef/knife/ec2_server_create.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/chef/knife/ec2_server_create.rb b/lib/chef/knife/ec2_server_create.rb index 69ba4a22..a2de387b 100644 --- a/lib/chef/knife/ec2_server_create.rb +++ b/lib/chef/knife/ec2_server_create.rb @@ -68,6 +68,16 @@ class Ec2ServerCreate < Knife :long => "--node-name NAME", :description => "The Chef node name for your new node" + option :dns_hostname, + :short => "-H DNS_HOSTNAME", + :long => "--dns-hostname DNS_HOSTNAME", + :description => "The DNS Hostname to use for new node" + + option :dns_domain, + :short => "-D DNS_DOMAIN", + :long => "--dns-domain DNS_DOMAIN", + :description => "The DNS Domain to use for new node" + option :ssh_key_name, :short => "-S KEY", :long => "--ssh-key KEY", @@ -321,6 +331,10 @@ def bootstrap_for_node(server) bootstrap.config[:use_sudo] = true unless config[:ssh_user] == 'root' bootstrap.config[:template_file] = locate_config_value(:template_file) bootstrap.config[:environment] = config[:environment] + bootstrap.config[:ip_address] = server.private_ip_address + bootstrap.config[:dns_hostname] = config[:dns_hostname] + bootstrap.config[:dns_domain] = config[:dns_domain] + # may be needed for vpc_mode bootstrap.config[:no_host_key_verify] = config[:no_host_key_verify] bootstrap