Modify creation of GCE Instance

This commit adjusts the creation of the GCE instance, specifically
related to the addition of the `sshKeys` metadata. That key has been
deprecated in favor of `ssh-keys` [1].
Also changed is the association of the ssh key with the root user, which
is by default disabled on GCP public images [2].

[1] https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
[2] https://cloud.google.com/compute/docs/instances/ssh-keys#root
This commit is contained in:
Casey Lang 2017-04-07 09:38:02 -05:00
parent 3df33c0eba
commit 555c7db7cf

View file

@ -15,10 +15,10 @@
zone: "{{ zone }}"
machine_type: f1-micro
image: ubuntu-1604
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file_path }}"
project_id: "{{ project_id }}"
metadata: '{"sshKeys":"root:{{ ssh_public_key_lookup }}"}'
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file_path }}"
project_id: "{{ project_id }}"
metadata: '{"ssh-keys":"ubuntu:{{ ssh_public_key_lookup }}"}'
tags:
- "environment-algo"
register: google_vm