B #5453: DO ip_range, vpc name and inputs

- ip_range is pick from 172.16.0.0/12 range using cluster ID
- name is generated with vpc-one-<cluster_id>
- inputs preselect some droplet sizes
This commit is contained in:
Ruben S. Montero committed 2021-07-08 08:44:35 +00:00
1 parent 6454dcafab
commit ee6b81f830
7 files changed
+25 -35

No files matched your search

@@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'ams3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'
@@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'lon1'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'
@@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'nyc3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'
@@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'sfo3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'
@@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'sgp1'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'
@@ -22,14 +22,29 @@ inputs:
default: '1'
- name: 'digitalocean_image'
type: text
type: list
description: "Droplet host operating system"
default: 'centos-8-x64'
options:
- 'centos-8-x64'
- name: 'digitalocean_size'
type: text
description: "Droplet size"
type: list
description: "Size of droplet. Basic droplets start with s-, memory optimize with m- and CPU optimize are c-"
default: 's-1vcpu-1gb'
options:
- 's-1vcpu-1gb'
- 's-1vcpu-2gb'
- 's-1vcpu-3gb'
- 's-2vcpu-2gb'
- 's-2vcpu-4gb'
- 's-4vcpu-8gb'
- 's-8vcpu-16gb'
- 'm-2vcpu-16gb'
- 'm-8vcpu-64gb'
- 'c-2'
- 'c-4'
- 'c-8'
- name: 'one_hypervisor'
type: list
@@ -1,5 +1,10 @@
resource "digitalocean_vpc" "device_<%= obj['ID'] %>" {
name = "vpc-digitalocean-<%= provision['REGION'] %>"
name = "vpc-one-<%= obj['ID'] %>"
region = "<%= provision['REGION'] %>"
ip_range = "10.10.10.0/24"
<%
net_id = obj['ID'].to_i
id_h = (( net_id & 3840) >> 8) + 16
id_l = net_id & 255
%>
ip_range = "172.<%= id_h %>.<%= id_l %>.0/24"
}