Skip to content

Commit

Permalink
Use correct SSH keys metadata for GCE provisioning. (StreisandEffect#…
Browse files Browse the repository at this point in the history
…1048)

Per the GCE docs on SSH metadata[0]:
> Note: Setting the sshKeys metadata value on project metadata is
> deprecated. Use the ssh-keys metadata value instead. If instances in
> your project uses older images, you might need to update the guest
> environments for these instances.

This commit updates the metadata key to be "ssh-keys" instead of
"sshKeys", fixing the problem where GCE provisioning required manual
intervention to fix SSH access.

[0] - https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
  • Loading branch information
cpu committed Nov 10, 2017
1 parent e48758e commit ca2106e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion playbooks/roles/genesis-google/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
service_account_email: "{{ gce_service_account_email }}"
image: "{{ gce_image }}"
tags: "{{ gce_server_name }}"
metadata: '{"sshKeys":"root:{{ ssh_key.stdout }}"}'
metadata: '{"ssh-keys":"ubuntu:{{ ssh_key.stdout }}"}'
register: streisand_server

- name: Wait until the server has finished booting and OpenSSH is accepting connections
Expand Down

0 comments on commit ca2106e

Please sign in to comment.