Skip to content
Snippets Groups Projects
Commit c52fd6cc authored by František Řezníček's avatar František Řezníček
Browse files

feat: add G1 -> G2 migration demo

parent 0ecaab65
No related branches found
No related tags found
No related merge requests found
Showing
with 67 additions and 0 deletions
../common/instances.tf
\ No newline at end of file
../common/keypair.tf
\ No newline at end of file
../common/networks.tf
\ No newline at end of file
../common/nodes-cloudinit.txt
\ No newline at end of file
# Floating IPs
resource "openstack_networking_floatingip_v2" "nodes_fips" {
count = var.nodes_count
pool = var.public_external_network
}
resource "openstack_compute_floatingip_associate_v2" "nodes_fips_associations" {
count = var.nodes_count
floating_ip = element(openstack_networking_floatingip_v2.nodes_fips.*.address, count.index)
instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index)
}
../common/providers.tf
\ No newline at end of file
../common/secgroup_rules.tf
\ No newline at end of file
../common/variables.tf
\ No newline at end of file
../common/volumes.tf
\ No newline at end of file
users:
- default
- name: ubuntu
shell: /bin/bash
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73
ssh_pwauth: false
resource "openstack_compute_instance_v2" "bastion" {
name = "${var.infra_name}-${var.bastion_name}"
image_name = var.bastion_image
flavor_name = var.bastion_flavor
key_pair = openstack_compute_keypair_v2.pubkey.name
security_groups = [openstack_networking_secgroup_v2.secgroup_default.name]
user_data = "#cloud-config\nhostname: ${var.infra_name}-${var.bastion_name}.local\n${file("${path.module}/bastion-cloudinit.txt")}"
network {
uuid = var.internal_network_creation_enable ? openstack_networking_network_v2.network_default[0].id : data.openstack_networking_network_v2.internal_shared_personal_network[0].id
port = openstack_networking_port_v2.bastion_port.id
}
}
# Floating IPs (only for bastion node)
resource "openstack_networking_floatingip_v2" "bastion_fip" {
pool = var.public_external_network
}
resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" {
floating_ip = openstack_networking_floatingip_v2.bastion_fip.address
instance_id = openstack_compute_instance_v2.bastion.id
}
# Ports
resource "openstack_networking_port_v2" "bastion_port" {
name = "${var.infra_name}-${var.bastion_name}-port"
network_id = var.internal_network_creation_enable ? openstack_networking_network_v2.network_default[0].id : data.openstack_networking_network_v2.internal_shared_personal_network[0].id
admin_state_up = "true"
security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id]
fixed_ip {
subnet_id = var.internal_subnet_creation_enable ? openstack_networking_subnet_v2.subnet_default[0].id : data.openstack_networking_subnet_v2.internal_shared_personal_subnet[0].id
}
}
../common/instances.tf
\ No newline at end of file
../common/keypair.tf
\ No newline at end of file
../common/networks.tf
\ No newline at end of file
../common/nodes-cloudinit.txt
\ No newline at end of file
../common/providers.tf
\ No newline at end of file
../common/secgroup_rules.tf
\ No newline at end of file
../common/variables.tf
\ No newline at end of file
../common/volumes.tf
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment