From b57d0748bfb8a9e595d925d5e7788a6ea3a821f0 Mon Sep 17 00:00:00 2001 From: Henri Rosten Date: Wed, 10 Jan 2024 08:58:26 +0200 Subject: [PATCH] builder: debug: allow ssh, reduce instances Signed-off-by: Henri Rosten --- terraform/jenkins/builder.tf | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/terraform/jenkins/builder.tf b/terraform/jenkins/builder.tf index f1de6622..d9e145d1 100644 --- a/terraform/jenkins/builder.tf +++ b/terraform/jenkins/builder.tf @@ -18,7 +18,7 @@ module "builder_image" { } locals { - num_builders = 2 + num_builders = 1 } module "builder_vm" { @@ -34,12 +34,17 @@ module "builder_vm" { virtual_machine_source_image = module.builder_image.image_id virtual_machine_custom_data = join("\n", ["#cloud-config", yamlencode({ - users = [{ - name = "remote-build" - ssh_authorized_keys = [ - tls_private_key.ed25519_remote_build.public_key_openssh - ] - }] + users = [ + { + name = "hrosten" + sudo = "ALL=(ALL) NOPASSWD:ALL" + ssh_authorized_keys = local.ssh_keys["hrosten"] + }, + { + name = "remote-build" + ssh_authorized_keys = tls_private_key.ed25519_remote_build.public_key_openssh + }, + ] write_files = [ { content = "AZURE_STORAGE_ACCOUNT_NAME=${azurerm_storage_account.binary_cache.name}", @@ -48,6 +53,7 @@ module "builder_vm" { ], })]) + allocate_public_ip = true subnet_id = azurerm_subnet.builders.id } @@ -74,7 +80,8 @@ resource "azurerm_network_security_group" "builder_vm" { protocol = "Tcp" source_port_range = "*" destination_port_ranges = [22] - source_address_prefix = azurerm_subnet.jenkins.address_prefixes[0] + #source_address_prefix = azurerm_subnet.jenkins.address_prefixes[0] + source_address_prefix = "*" destination_address_prefix = "*" } }