1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-10 00:58:17 +03:00

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

(cherry picked from commit ee6b81f830bb617b3c2f129c7e798d04378dea0d)
This commit is contained in:
Ruben S. Montero 2021-07-08 08:44:35 +00:00 committed by Sergio Betanzos
parent 73680b39b0
commit 4d80a8d725
No known key found for this signature in database
GPG Key ID: E3E704F097737136
7 changed files with 25 additions and 35 deletions

View File

@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'ams3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'

View File

@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'lon1'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'

View File

@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'nyc3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'

View File

@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'sfo3'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'

View File

@ -11,9 +11,3 @@ plain:
connection:
token: 'DigitalOcean token'
region: 'sgp1'
inputs:
- name: 'digitalocean_droplet'
type: 'list'
options:
- 'centos-8-x64'

View File

@ -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

View File

@ -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"
}