infra: pin nix (#17484)

This commit is contained in:
Gary Verhaegen 2023-09-27 13:32:23 +02:00 committed by GitHub
parent 8ef67285e5
commit ee08d89f13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 1 deletions

View File

@ -9,12 +9,14 @@ locals {
disk_size = 400,
size = 0,
assignment = "default",
nix = "su --command \"sh <(curl -sSfL https://nixos.org/nix/install) --daemon\" --login vsts"
},
{
name = "ci-u2",
disk_size = 400,
size = 0,
assignment = "default",
nix = "su --command \"sh <(curl -sSfL https://nixos.org/nix/install) --daemon\" --login vsts"
},
],
azure = [
@ -23,12 +25,14 @@ locals {
disk_size = 400,
size = 10,
assignment = "default",
nix = "su --command \"sh <(curl -sSfL https://releases.nixos.org/nix/nix-2.17.0/install) --daemon\" --login vsts"
},
{
name = "du2",
disk_size = 400,
size = 0,
assignment = "default",
nix = "su --command \"sh <(curl -sSfL https://releases.nixos.org/nix/nix-2.17.0/install) --daemon\" --login vsts"
},
]
}

View File

@ -28,6 +28,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "ubuntu" {
size = local.ubuntu.azure[count.index].disk_size
gcp_logging = ""
assignment = local.ubuntu.azure[count.index].assignment
nix = local.ubuntu.azure[count.index].nix
}))
source_image_reference {

View File

@ -55,6 +55,7 @@ curl -sSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
curl -sSL https://dl.google.com/cloudagents/add-logging-agent-repo.sh | bash -s -- --also-install
EOF
assignment = local.ubuntu.gcp[count.index].assignment
nix = local.ubuntu.gcp[count.index].nix
})
shutdown-script = nonsensitive("#!/usr/bin/env bash\nset -euo pipefail\ncd /home/vsts/agent\nsu vsts <<SHUTDOWN_AGENT\nexport VSTS_AGENT_INPUT_TOKEN='${secret_resource.vsts-token.value}'\n./config.sh remove --unattended --auth PAT\nSHUTDOWN_AGENT\n ")

View File

@ -198,7 +198,7 @@ chown --recursive root:root /home/vsts/agent/{*.sh,bin,externals}
# This needs to run inside of a user with sudo access
echo "vsts ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/nix_installation
su --command "sh <(curl -sSfL https://nixos.org/nix/install) --daemon" --login vsts
${nix}
rm /etc/sudoers.d/nix_installation
# Note: the "hydra.da-int.net" string is now part of the name of the key for