From b9728ab37668717ad794fea5bc7e0caba48760cd Mon Sep 17 00:00:00 2001 From: Sanjay Srikakulam Date: Wed, 25 Jan 2023 11:03:54 +0100 Subject: [PATCH] Add new maintenance VM This VM will be used for running cronjobs, cleanups, hosting primary galaxy codebase (rsync will be used to keep sn06 and sn07 in sync), monitoring via influxdb --- instance_maintenance.tf | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 instance_maintenance.tf diff --git a/instance_maintenance.tf b/instance_maintenance.tf new file mode 100644 index 00000000..e9fbb7e8 --- /dev/null +++ b/instance_maintenance.tf @@ -0,0 +1,40 @@ +data "openstack_images_image_v2" "maintenance-image" { + name = "Rocky 9.0" +} + +resource "openstack_compute_instance_v2" "maintenance" { + name = "maintenance.galaxyproject.eu" + image_id = data.openstack_images_image_v2.maintenance-image.id + flavor_name = "m1.xlarge" + key_pair = "cloud2" + tags = [] + security_groups = ["default"] + + network { + name = "bioinf" + } + + block_device { + uuid = data.openstack_images_image_v2.maintenance-image.id + source_type = "image" + volume_size = 256 + destination_type = "volume" + boot_index = 0 + delete_on_termination = true + } + + user_data = <<-EOF + #cloud-config + package_update: true + package_upgrade: true + EOF +} + +resource "aws_route53_record" "maintenance-galaxyproject" { + allow_overwrite = true + zone_id = var.zone_galaxyproject_eu + name = "maintenance.galaxyproject.eu" + type = "A" + ttl = "600" + records = ["${openstack_compute_instance_v2.maintenance.access_ip_v4}"] +}