-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompute-instances.yaml
36 lines (36 loc) · 1.24 KB
/
compute-instances.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
- name: Compute instances
gcp_compute_instance:
name: "{{ role }}-{{ item }}"
can_ip_forward: yes
machine_type: "{{ machine_type }}"
network_interfaces:
- network: "{{ network }}"
access_configs:
- name: External NAT
nat_ip: "{{ address.results[item] }}"
type: ONE_TO_ONE_NAT
network_ip: "10.240.0.{{ prefix|string }}{{ item|string }}"
subnetwork: "{{ subnetwork }}"
project: "{{ project }}"
disks:
- auto_delete: true
boot: true
source: "{{ disk.results[item] }}"
zone: "{{ zone }}"
auth_kind: "{{ auth_kind }}"
metadata:
pod-cidr: "{{ '10.200.' + item | string + '.0/24' if role == 'worker' else omit }}"
service_account_file: "{{ service_account_file }}"
scopes:
- 'https://www.googleapis.com/auth/compute'
- 'https://www.googleapis.com/auth/devstorage.read_only'
- 'https://www.googleapis.com/auth/logging.write'
- 'https://www.googleapis.com/auth/monitoring'
- 'https://www.googleapis.com/auth/service.management.readonly'
- 'https://www.googleapis.com/auth/servicecontrol'
state: "{{ state }}"
tags:
items:
- "{{ network_name }}"
- "{{ role }}"
loop: "{{ range(count|int) | list }}"