From 3e29881ece6311a073d34c5adab5fdc04d6d1ce2 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Mon, 19 Jul 2021 14:55:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BB=EF=B8=8F=20Add=20image=20setting?= =?UTF-8?q?=20for=20OpenStack=20TF=20infra=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare-vms/infra/example.openstack-tf | 1 + prepare-vms/terraform/machines.tf | 4 +++- prepare-vms/terraform/vars.tf | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/prepare-vms/infra/example.openstack-tf b/prepare-vms/infra/example.openstack-tf index bad23dfa..90fdbdc1 100644 --- a/prepare-vms/infra/example.openstack-tf +++ b/prepare-vms/infra/example.openstack-tf @@ -8,3 +8,4 @@ export TF_VAR_domain="Default" export TF_VAR_password="..." export TF_VAR_auth_url="https://api.r1.nxs.enix.io/v3" export TF_VAR_flavor="GP1.S" +export TF_VAR_image="Ubuntu 20.04.1" diff --git a/prepare-vms/terraform/machines.tf b/prepare-vms/terraform/machines.tf index 78b9da6a..07b30eff 100644 --- a/prepare-vms/terraform/machines.tf +++ b/prepare-vms/terraform/machines.tf @@ -1,7 +1,7 @@ resource "openstack_compute_instance_v2" "machine" { count = "${var.count}" name = "${format("%s-%04d", "${var.prefix}", count.index+1)}" - image_name = "Ubuntu 18.04.4 20200324" + image_name = "${var.image}" flavor_name = "${var.flavor}" security_groups = ["${openstack_networking_secgroup_v2.full_access.name}"] key_pair = "${openstack_compute_keypair_v2.ssh_deploy_key.name}" @@ -30,3 +30,5 @@ output "ip_addresses" { } variable "flavor" {} + +variable "image" {} diff --git a/prepare-vms/terraform/vars.tf b/prepare-vms/terraform/vars.tf index 61c3e7e4..26f7337c 100644 --- a/prepare-vms/terraform/vars.tf +++ b/prepare-vms/terraform/vars.tf @@ -5,4 +5,3 @@ variable "prefix" { variable "count" { type = "string" } -