mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-06 15:13:56 +02:00
GCE. env variables #195
This commit is contained in:
parent
573c2f2322
commit
906d962d4d
1 changed files with 11 additions and 4 deletions
|
@ -1,16 +1,23 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
credentials_file_lookup: "{{ lookup('file', '{{ credentials_file }}') }}"
|
credentials_file_path: "{{ credentials_file | default(lookup('env','GCE_CREDENTIALS_FILE_PATH')) }}"
|
||||||
ssh_public_key_lookup: "{{ lookup('file', '{{ SSH_keys.public }}') }}"
|
ssh_public_key_lookup: "{{ lookup('file', '{{ SSH_keys.public }}') }}"
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
credentials_file_lookup: "{{ lookup('file', '{{ credentials_file_path }}') }}"
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
service_account_email: "{{ credentials_file_lookup.client_email | default(lookup('env','GCE_EMAIL')) }}"
|
||||||
|
project_id: "{{ credentials_file_lookup.project_id | default(lookup('env','GCE_PROJECT')) }}"
|
||||||
|
|
||||||
- name: "Creating a new instance..."
|
- name: "Creating a new instance..."
|
||||||
gce:
|
gce:
|
||||||
instance_names: "{{ server_name }}"
|
instance_names: "{{ server_name }}"
|
||||||
zone: "{{ zone }}"
|
zone: "{{ zone }}"
|
||||||
machine_type: f1-micro
|
machine_type: f1-micro
|
||||||
image: ubuntu-1604
|
image: ubuntu-1604
|
||||||
service_account_email: "{{ credentials_file_lookup.client_email }}"
|
service_account_email: "{{ service_account_email }}"
|
||||||
credentials_file: "{{ credentials_file }}"
|
credentials_file: "{{ credentials_file_path }}"
|
||||||
project_id: "{{ credentials_file_lookup.project_id }}"
|
project_id: "{{ project_id }}"
|
||||||
metadata: '{"sshKeys":"root:{{ ssh_public_key_lookup }}"}'
|
metadata: '{"sshKeys":"root:{{ ssh_public_key_lookup }}"}'
|
||||||
tags:
|
tags:
|
||||||
- "environment-algo"
|
- "environment-algo"
|
||||||
|
|
Loading…
Add table
Reference in a new issue