From 2a50de41d37700f818a0772ccf2350a252b04a72 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Thu, 11 Aug 2022 12:04:33 +0100 Subject: [PATCH] Replace compute instance when deploy key changes --- roles/infra/templates/resources.tf.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/infra/templates/resources.tf.j2 b/roles/infra/templates/resources.tf.j2 index d41c53c8..f41d566c 100644 --- a/roles/infra/templates/resources.tf.j2 +++ b/roles/infra/templates/resources.tf.j2 @@ -105,6 +105,11 @@ resource "openstack_compute_instance_v2" "node" { network { port = openstack_networking_port_v2.port_internal.id } + lifecycle { + replace_triggered_by = [ + openstack_compute_keypair_v2.keypair_deploy + ] + } } resource "openstack_blockstorage_volume_v3" "data_volume" {