From fbf33a78431ddc8281f1da6c1dd2b8b4936d140b Mon Sep 17 00:00:00 2001 From: Maxime Noel Date: Fri, 10 Jan 2025 13:07:08 +1300 Subject: [PATCH] Dont get client tool for server proxy containerized and dont disable repo for paygo images --- backend_modules/aws/host/combustion | 49 ----------------------------- backend_modules/aws/host/main.tf | 17 ++-------- salt/repos/disable_local.sls | 2 +- 3 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 backend_modules/aws/host/combustion diff --git a/backend_modules/aws/host/combustion b/backend_modules/aws/host/combustion deleted file mode 100644 index f5b16411a..000000000 --- a/backend_modules/aws/host/combustion +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# combustion: network prepare -set -euxo pipefail - -function nm_config() { - connectiondir="/etc/NetworkManager/system-connections" - connectionfile="$connectiondir/Wired connection $1.nmconnection" - mkdir -p "$connectiondir" - cat > "$connectionfile" < >(exec tee -a /var/log/combustion) 2>&1 - -# Name the Network Manager connections (final phase on real filesystem) -nm_config 1 eth0 auto -nm_config 2 eth1 manual - -# Set linux as password for root -echo 'root:$6$3aQC9rrDLHiTf1yR$NoKe9tko0kFIpu0rQ2y/OzOOtbVvs0Amr2bx0T4cGf6aq8PG74EmVy8lSDJdbLVVFpOSzwELWyReRCiPHa7DG0' | chpasswd -e - -echo "PermitRootLogin yes" > /etc/ssh/sshd_config -echo "ChallengeResponseAuthentication yes" >> /etc/ssh/sshd_config -echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config -echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOSLK0kJAulwO9Qwm/DVKLsGzv8Fh+ZcGe5x5d+VzO4/+xKnxjOPvGVngm9Hki8N436bCCvIRqwzstDUyJnTHhEe3qzsl02QGqIIfVjzK3BEp4sA8XcmByBy3pxqbTjAjrW8a+n43DBRMx4J86LgywX3fFt8ceEym3rFer/IzQD9QvKRocycNCwhpmGKEDh4zdl9PdyU5RcUpiA01AD/8rdJMNYnUxIsaNElcgP2LSzROjNdyu11cq9h3/cb3b7oRRef718GOkIkzqL/szo4Mm/j4KfyG0SBWyPxlJktFADD3lcQIRrGakFhiZOFbg2HZci26q+l/hUfLMbzcBrWlc+gzY4z4LMF8YBy1x/x+yR4j1SzZuqempSRu7rDKevcIGBF/fALPyiXH2EzYKsVcN9nv5mFCjmwVK7WTjw1SFzufKwdmnvOYgyeYuMaOJv3LEBY1jJg8r4xqzuQx32KNK/iJz1E+njptV3ZhOYDiHBmieykP08nWxdS79N1DbljxRzS54T7CArfGo23nYTNlMewPeKFx7ZqtUVv03g8i1Hn8WdArz2TYciWWrPErBEALBpXsu7Oq5AT97wAhcAIf3B3dV5p/bXgnhALA/SodNBf/wr0U2f5VzTDyJ9eNZURt16jSxDgXkuKKY/rimLqqt2FC1SeicmTql1nVyHG3j9Q== root@controller" > /root/.ssh/authorized_keys - -# Add a public ssh key and enable sshd -systemctl enable sshd.service -systemctl enable sshd.service diff --git a/backend_modules/aws/host/main.tf b/backend_modules/aws/host/main.tf index bd262f8c9..99d95bfd6 100644 --- a/backend_modules/aws/host/main.tf +++ b/backend_modules/aws/host/main.tf @@ -47,12 +47,10 @@ locals { second_data_disk_device = split(".", local.provider_settings["instance_type"])[0] == "t2" ? "xvdf" : "nvme2n1" host_eip = local.provider_settings["public_instance"] && local.provider_settings["instance_with_eip"]? true: false - - combustion_images = ["suma-proxy-50-byos"] - combustion = contains(local.combustion_images, var.image) } data "template_file" "user_data" { + count = var.quantity > 0 ? var.quantity : 0 template = file("${path.module}/user_data.yaml") vars = { image = var.image @@ -62,16 +60,6 @@ data "template_file" "user_data" { } } -data "template_file" "combustion" { - template = file("${path.module}/combustion") - vars = { - image = var.image - public_instance = local.provider_settings["public_instance"] - mirror_url = var.base_configuration["mirror"] - install_salt_bundle = var.install_salt_bundle - } -} - resource "aws_eip" "host_eip" { count = local.host_eip ? var.quantity : 0 @@ -105,8 +93,7 @@ resource "aws_instance" "instance" { volume_type = "gp3" } -# user_data = data.template_file.user_data[count.index].rendered - user_data = local.combustion ? data.template_file.combustion.rendered : data.template_file.user_data.rendered + user_data = data.template_file.user_data[count.index].rendered # WORKAROUND: ephemeral block devices are defined in any case # they will only be used for instance types that provide them diff --git a/salt/repos/disable_local.sls b/salt/repos/disable_local.sls index 7ad7e08d1..4652548c0 100644 --- a/salt/repos/disable_local.sls +++ b/salt/repos/disable_local.sls @@ -3,4 +3,4 @@ disable_all_local_repos: cmd.run: - name: zypper mr -d --all - onlyif: test -x /usr/bin/zypper -{% endif %} \ No newline at end of file +{% endif %}