|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
credentials_file_lookup: "{{ lookup('file', '{{ credentials_file }}') }}"
|
|
|
|
|
ssh_public_key_lookup: "{{ lookup('file', '{{ ssh_public_key }}') }}"
|
|
|
|
|
|
|
|
|
|
- name: "Creating a droplet..."
|
|
|
|
|
- name: "Creating a new instance..."
|
|
|
|
|
gce:
|
|
|
|
|
instance_names: "{{ server_name }}"
|
|
|
|
|
zone: "{{ zones[zone] }}"
|
|
|
|
@ -14,7 +14,7 @@
|
|
|
|
|
metadata: '{"sshKeys":"root:{{ ssh_public_key_lookup }}"}'
|
|
|
|
|
register: google_vm
|
|
|
|
|
|
|
|
|
|
- name: Add the droplet to an inventory group
|
|
|
|
|
- name: Add the instance to an inventory group
|
|
|
|
|
add_host:
|
|
|
|
|
name: "{{ google_vm.instance_data[0].public_ip}}"
|
|
|
|
|
groups: vpn-host
|
|
|
|
@ -35,5 +35,5 @@
|
|
|
|
|
credentials_file: "{{ credentials_file }}"
|
|
|
|
|
project_id: "{{ credentials_file_lookup.project_id }}"
|
|
|
|
|
|
|
|
|
|
- name: Wait for SSH to become available
|
|
|
|
|
- name: Waiting for SSH to become available
|
|
|
|
|
local_action: "wait_for port=22 host={{ google_vm.instance_data[0].public_ip }} timeout=320"
|
|
|
|
|