Skip to content

Instantly share code, notes, and snippets.

@Vasu1105
Created April 9, 2015 13:11
Show Gist options
  • Save Vasu1105/50c8cb1003e3bb4859f4 to your computer and use it in GitHub Desktop.
Save Vasu1105/50c8cb1003e3bb4859f4 to your computer and use it in GitHub Desktop.
Knife google bootstrap issue with --gce-public-ip set to 'none'
diff --git a/lib/chef/knife/google_server_create.rb b/lib/chef/knife/google_server_create.rb
index 2c8d2a2..c7f8309 100644
--- a/lib/chef/knife/google_server_create.rb
+++ b/lib/chef/knife/google_server_create.rb
@@ -563,7 +563,7 @@ class Chef
network_interface.merge!('accessConfigs' =>[{"name"=>"External NAT",
"type"=>"ONE_TO_ONE_NAT", "natIP"=>config[:public_ip] }])
elsif config[:public_ip] == 'NONE'
- # do nothing
+ config[:instance_connect_ip] = 'PRIVATE'
else
ui.error("Invalid public ip value : #{config[:public_ip]}")
exit 1
@@ -585,7 +585,7 @@ class Chef
:tags => { 'items' => config[:tags] }
)
else
- zone_operation = client.instances.create(:name => @name_args.first,
+ zone_operation = client.instances.create(:name => @name_args.first,
:zone=> selflink2name(zone),
:machineType => machine_type,
:disks => disks,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment