update config

This commit is contained in:
2025-06-12 23:58:08 +02:00
parent bbcdccdfb7
commit 17cf46c3fd
8 changed files with 2244 additions and 269 deletions
+90 -78
View File
@@ -7,7 +7,7 @@ provider "openstack" {
}
provider "openstack" {
alias = "octavia"
alias = "octavia"
user_name = "octavia"
tenant_name = "service"
password = "L8dZsrWOtNI8UvLVGKseC3FB5tRZ0cZTI1xw87Ns"
@@ -28,31 +28,34 @@ resource "openstack_identity_project_v3" "hnrx-dev" {
# Networks
resource "openstack_networking_network_v2" "hnrx-prod" {
name = "hnrx-prod"
name = "hnrx-prod"
admin_state_up = "true"
shared = true
external = true
shared = true
external = true
dns_domain = "hnrx.cloud."
segments {
physical_network = "physnet1"
segmentation_id = 113
network_type = "vlan"
segmentation_id = 113
network_type = "vlan"
}
}
resource "openstack_networking_network_v2" "hnrx-dev" {
name = "hnrx-dev"
name = "hnrx-dev"
admin_state_up = "true"
shared = true
external = true
shared = true
external = true
dns_domain = "hnrx.dev.cloud."
segments {
physical_network = "physnet1"
segmentation_id = 112
network_type = "vlan"
segmentation_id = 112
network_type = "vlan"
}
}
resource "openstack_networking_network_v2" "internal" {
name = "internal"
name = "internal"
shared = true
}
@@ -63,10 +66,10 @@ resource "openstack_networking_subnet_v2" "hnrx-prod" {
cidr = "192.168.113.0/24"
allocation_pool {
start = "192.168.113.10"
end = "192.168.113.200"
end = "192.168.113.200"
}
enable_dhcp = true
gateway_ip = "192.168.113.1"
gateway_ip = "192.168.113.1"
}
resource "openstack_networking_subnet_v2" "hnrx-dev" {
@@ -75,16 +78,17 @@ resource "openstack_networking_subnet_v2" "hnrx-dev" {
cidr = "192.168.112.0/24"
allocation_pool {
start = "192.168.112.10"
end = "192.168.112.200"
end = "192.168.112.200"
}
enable_dhcp = true
gateway_ip = "192.168.112.1"
gateway_ip = "192.168.112.1"
}
resource "openstack_networking_subnet_v2" "internal-subnet" {
name = "internal-subnet"
network_id = openstack_networking_network_v2.internal.id
cidr = "10.0.10.0/24"
name = "internal-subnet"
network_id = openstack_networking_network_v2.internal.id
cidr = "10.0.10.0/24"
dns_nameservers = ["192.168.1.1"]
}
@@ -106,10 +110,10 @@ resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_1" {
resource "openstack_networking_secgroup_rule_v2" "default_sg_icmp" {
security_group_id = openstack_networking_secgroup_v2.hnrx_default.id
direction = "ingress"
protocol = "icmp"
remote_ip_prefix = "0.0.0.0/0"
ethertype = "IPv4"
direction = "ingress"
protocol = "icmp"
remote_ip_prefix = "0.0.0.0/0"
ethertype = "IPv4"
}
# Router
@@ -126,82 +130,82 @@ resource "openstack_networking_router_interface_v2" "router_interface_1" {
# Flavors
resource "openstack_compute_flavor_v2" "m1-tiny" {
name = "m1.tiny"
ram = "512"
vcpus = "1"
disk = "5"
name = "m1.tiny"
ram = "512"
vcpus = "1"
disk = "5"
is_public = true
}
resource "openstack_compute_flavor_v2" "m1-small" {
name = "m1.small"
ram = "1024"
vcpus = "1"
disk = "10"
name = "m1.small"
ram = "1024"
vcpus = "1"
disk = "10"
is_public = true
}
resource "openstack_compute_flavor_v2" "m1-medium" {
name = "m1.medium"
ram = "2048"
vcpus = "1"
disk = "20"
name = "m1.medium"
ram = "2048"
vcpus = "1"
disk = "20"
is_public = true
}
resource "openstack_compute_flavor_v2" "m1-large" {
name = "m1.large"
ram = "4096"
vcpus = "1"
disk = "40"
name = "m1.large"
ram = "4096"
vcpus = "1"
disk = "40"
is_public = true
}
resource "openstack_compute_flavor_v2" "m1-xlarge" {
name = "m1.xlarge"
ram = "8192"
vcpus = "1"
disk = "80"
name = "m1.xlarge"
ram = "8192"
vcpus = "1"
disk = "80"
is_public = true
}
resource "openstack_compute_flavor_v2" "c2-tiny" {
name = "c2.tiny"
ram = "1024"
vcpus = "2"
disk = "25"
name = "c2.tiny"
ram = "1024"
vcpus = "2"
disk = "25"
is_public = true
}
resource "openstack_compute_flavor_v2" "c2-small" {
name = "c2.small"
ram = "2048"
vcpus = "2"
disk = "50"
name = "c2.small"
ram = "2048"
vcpus = "2"
disk = "50"
is_public = true
}
resource "openstack_compute_flavor_v2" "c2-medium" {
name = "c2.medium"
ram = "4096"
vcpus = "2"
disk = "75"
name = "c2.medium"
ram = "4096"
vcpus = "2"
disk = "75"
is_public = true
}
resource "openstack_compute_flavor_v2" "c2-large" {
name = "c2.large"
ram = "8192"
vcpus = "2"
disk = "100"
name = "c2.large"
ram = "8192"
vcpus = "2"
disk = "100"
is_public = true
}
resource "openstack_compute_flavor_v2" "c2-xlarge" {
name = "c2.xlarge"
ram = "16384"
vcpus = "2"
disk = "200"
name = "c2.xlarge"
ram = "16384"
vcpus = "2"
disk = "200"
is_public = true
}
@@ -211,7 +215,7 @@ resource "openstack_images_image_v2" "cirros" {
image_source_url = "https://files.hnrx.net/OS-Images/cirros-0.6.3-x86_64-disk.img"
container_format = "bare"
disk_format = "qcow2"
web_download = true
web_download = true
}
resource "openstack_images_image_v2" "fedora-41" {
@@ -219,13 +223,13 @@ resource "openstack_images_image_v2" "fedora-41" {
image_source_url = "https://files.hnrx.net/OS-Images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2"
container_format = "bare"
disk_format = "qcow2"
web_download = true
web_download = true
}
resource "openstack_images_image_v2" "opensuse" {
name = "openSUSE-Leap-15.6.x86_64-1.0.4"
image_source_url = "https://files.hnrx.net/OS-Images/openSUSE-Leap-15.6.x86_64-1.0.4.qcow2"
web_download = true
web_download = true
container_format = "bare"
disk_format = "qcow2"
}
@@ -233,37 +237,45 @@ resource "openstack_images_image_v2" "opensuse" {
resource "openstack_images_image_v2" "talos" {
name = "talos-1.10.2"
image_source_url = "https://files.hnrx.net/OS-Images/talos-1.10.2-openstack-amd64.raw"
web_download = true
web_download = true
container_format = "bare"
disk_format = "raw"
}
resource "openstack_images_image_v2" "amphora" {
provider = openstack.octavia
provider = openstack.octavia
name = "amphora-x64-haproxy.qcow2"
image_source_url = "https://files.hnrx.net/OS-Images/amphora-x64-haproxy.qcow2"
web_download = true
web_download = true
container_format = "bare"
disk_format = "qcow2"
visibility = "private"
tags = ["amphora", "haproxy"]
visibility = "private"
tags = ["amphora", "haproxy"]
properties = {
"hw_architecture" = "x86_64"
"hw_rng_model" = "virtio"
}
"hw_rng_model" = "virtio"
}
}
# Keypairs
resource "openstack_compute_keypair_v2" "mh-key" {
name = "mh"
name = "mh"
public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFJ4YMDAlzgWhvlwKbiyjztiQHKOXwhwJt0VVmQKONj+ matthias.hinrichs@me.com"
}
#DNS Zone
resource "openstack_dns_zone_v2" "hnrx-zone" {
name = "hnrx.cloud."
name = "hnrx.cloud."
description = "default hnrx zone"
email = "matthias.hinrichs@hnrx.net"
type = "PRIMARY"
ttl = 60
email = "matthias.hinrichs@hnrx.net"
type = "PRIMARY"
ttl = 60
}
resource "openstack_dns_zone_v2" "hnrx-dev-zone" {
name = "dev.hnrx.cloud."
description = "default hnrx dev zone"
email = "matthias.hinrichs@hnrx.net"
type = "PRIMARY"
ttl = 60
#project_id = openstack_networking_subnet_v2.hnrx-dev.id
}