mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-07 07:33:52 +02:00
Create a VPC network for each instane (#561)
This commit is contained in:
parent
97248fce19
commit
e6c8f19d3c
1 changed files with 13 additions and 13 deletions
|
@ -10,6 +10,18 @@
|
||||||
service_account_email: "{{ credentials_file_lookup.client_email | default(lookup('env','GCE_EMAIL')) }}"
|
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')) }}"
|
project_id: "{{ credentials_file_lookup.project_id | default(lookup('env','GCE_PROJECT')) }}"
|
||||||
|
|
||||||
|
- name: Network configured
|
||||||
|
gce_net:
|
||||||
|
name: "algo-{{ server_name }}"
|
||||||
|
fwname: "algo-{{ server_name }}-fw"
|
||||||
|
allowed: "udp:500,4500;tcp:22;icmp"
|
||||||
|
state: "present"
|
||||||
|
mode: auto
|
||||||
|
src_range: 0.0.0.0/0
|
||||||
|
service_account_email: "{{ credentials_file_lookup.client_email }}"
|
||||||
|
credentials_file: "{{ credentials_file }}"
|
||||||
|
project_id: "{{ credentials_file_lookup.project_id }}"
|
||||||
|
|
||||||
- name: "Creating a new instance..."
|
- name: "Creating a new instance..."
|
||||||
gce:
|
gce:
|
||||||
instance_names: "{{ server_name }}"
|
instance_names: "{{ server_name }}"
|
||||||
|
@ -20,7 +32,7 @@
|
||||||
credentials_file: "{{ credentials_file_path }}"
|
credentials_file: "{{ credentials_file_path }}"
|
||||||
project_id: "{{ project_id }}"
|
project_id: "{{ project_id }}"
|
||||||
metadata: '{"ssh-keys":"ubuntu:{{ ssh_public_key_lookup }}"}'
|
metadata: '{"ssh-keys":"ubuntu:{{ ssh_public_key_lookup }}"}'
|
||||||
# ip_forward: true
|
network: "algo-{{ server_name }}"
|
||||||
tags:
|
tags:
|
||||||
- "environment-algo"
|
- "environment-algo"
|
||||||
register: google_vm
|
register: google_vm
|
||||||
|
@ -35,18 +47,6 @@
|
||||||
cloud_provider: gce
|
cloud_provider: gce
|
||||||
ipv6_support: no
|
ipv6_support: no
|
||||||
|
|
||||||
- name: Firewall configured
|
|
||||||
local_action:
|
|
||||||
module: gce_net
|
|
||||||
name: "{{ google_vm.instance_data[0].network }}"
|
|
||||||
fwname: "algo-ikev2"
|
|
||||||
allowed: "udp:500,4500;tcp:22"
|
|
||||||
state: "present"
|
|
||||||
src_range: 0.0.0.0/0
|
|
||||||
service_account_email: "{{ credentials_file_lookup.client_email }}"
|
|
||||||
credentials_file: "{{ credentials_file }}"
|
|
||||||
project_id: "{{ credentials_file_lookup.project_id }}"
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
cloud_instance_ip: "{{ google_vm.instance_data[0].public_ip }}"
|
cloud_instance_ip: "{{ google_vm.instance_data[0].public_ip }}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue