mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-06 15:13:56 +02:00
GCE: Static external ip (optional) (#1125)
This commit is contained in:
parent
810358f1cc
commit
6c0753e3b8
2 changed files with 22 additions and 4 deletions
|
@ -114,6 +114,7 @@ cloud_providers:
|
||||||
gce:
|
gce:
|
||||||
size: f1-micro
|
size: f1-micro
|
||||||
image: ubuntu-1804
|
image: ubuntu-1804
|
||||||
|
external_static_ip: false
|
||||||
lightsail:
|
lightsail:
|
||||||
size: nano_1_0
|
size: nano_1_0
|
||||||
image: ubuntu_16_04
|
image: ubuntu_16_04
|
||||||
|
|
|
@ -14,10 +14,27 @@
|
||||||
credentials_file: "{{ credentials_file_path }}"
|
credentials_file: "{{ credentials_file_path }}"
|
||||||
project_id: "{{ project_id }}"
|
project_id: "{{ project_id }}"
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: External IP allocated
|
||||||
|
gce_eip:
|
||||||
|
service_account_email: "{{ service_account_email }}"
|
||||||
|
credentials_file: "{{ credentials_file_path }}"
|
||||||
|
project_id: "{{ project_id }}"
|
||||||
|
name: "{{ algo_server_name }}"
|
||||||
|
region: "{{ algo_region.split('-')[0:2] | join('-') }}"
|
||||||
|
state: present
|
||||||
|
register: gce_eip
|
||||||
|
|
||||||
|
- name: Set External IP as a fact
|
||||||
|
set_fact:
|
||||||
|
external_ip: "{{ gce_eip.address }}"
|
||||||
|
when: cloud_providers.gce.external_static_ip
|
||||||
|
|
||||||
- name: "Creating a new instance..."
|
- name: "Creating a new instance..."
|
||||||
gce:
|
gce:
|
||||||
instance_names: "{{ algo_server_name }}"
|
instance_names: "{{ algo_server_name }}"
|
||||||
zone: "{{ algo_region }}"
|
zone: "{{ algo_region }}"
|
||||||
|
external_ip: "{{ external_ip | default('ephemeral') }}"
|
||||||
machine_type: "{{ cloud_providers.gce.size }}"
|
machine_type: "{{ cloud_providers.gce.size }}"
|
||||||
image: "{{ cloud_providers.gce.image }}"
|
image: "{{ cloud_providers.gce.image }}"
|
||||||
service_account_email: "{{ service_account_email }}"
|
service_account_email: "{{ service_account_email }}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue