From 555c7db7cfde7ad2e5033fa88905476b85f3527a Mon Sep 17 00:00:00 2001 From: Casey Lang Date: Fri, 7 Apr 2017 09:38:02 -0500 Subject: [PATCH] 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 --- roles/cloud-gce/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cloud-gce/tasks/main.yml b/roles/cloud-gce/tasks/main.yml index 9339113c..55e280a1 100644 --- a/roles/cloud-gce/tasks/main.yml +++ b/roles/cloud-gce/tasks/main.yml @@ -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