Skip to content

Commit

Permalink
Bump default rke2 version, remove naming convention check, bump azure…
Browse files Browse the repository at this point in the history
… provider version, add scoop install script in dev builds
  • Loading branch information
HarrisonWAffel committed Sep 30, 2024
1 parent 675b1f2 commit 287d33f
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 45 deletions.
2 changes: 1 addition & 1 deletion terraform/azure_active_directory/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.56.0"
version = "3.90.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/azure_docker_rancher/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.56.0"
version = "3.90.0"
}
digitalocean = {
source = "digitalocean/digitalocean"
Expand Down
2 changes: 1 addition & 1 deletion terraform/azure_rke2_cluster/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.56.0"
version = "3.90.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion terraform/azure_rke2_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variable "name" {
variable "kubernetes_version" {
type = string
description = "The version of RKE2 that you would like to use to provision a cluster."
default = "v1.25.16+rke2r1"
default = "v1.29.8+rke2r1"
}

variable "active_directory" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/azure_server/examples/windows_dev.tfvars
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
image = "windows"
image = "windows-2022"
dev_tools = true
27 changes: 0 additions & 27 deletions terraform/azure_server/files/install_choco.ps1

This file was deleted.

8 changes: 8 additions & 0 deletions terraform/azure_server/files/install_scoop.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Install scoop globally
$env:SCOOP="C:\ProgramData\Scoop"
$env:SCOOP_GLOBAL = "C:\ProgramData\Scoop"
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'Machine')
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')

irm get.scoop.sh -outfile 'install.ps1'
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
3 changes: 3 additions & 0 deletions terraform/azure_server/files/install_scoop_tools.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scoop install go
scoop install git
scoop install mage
4 changes: 1 addition & 3 deletions terraform/azure_server/files/setup_profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ if (!(Test-Path -Path $PROFILE.AllUsersCurrentHost)) {
}

$profileFile = @"
`$env:PATH += ";C:\ProgramData\chocolatey\bin"
`$null = Import-Module C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1
`$null = refreshenv
`$null = Import-Module -WarningAction Ignore -Name `"$toolsPsm1Path`"
$env:PATH += "C:\ProgramData\Scoop\shims"
Set-Item -Path Env:\CRI_CONFIG_FILE -Value `$env:ProgramData\crictl\crictl.yaml
"@
Expand Down
7 changes: 4 additions & 3 deletions terraform/azure_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ module "images" {
locals {
scripts = var.dev_tools && module.images.source_images[var.image].os == "windows" ? concat(
[
file("${path.module}/files/enable_features.ps1"),
file("${path.module}/files/install_choco.ps1"),
file("${path.module}/files/setup_profile.ps1"),
file("${path.module}/files/install_docker.ps1"),
file("${path.module}/files/install_containerd.ps1"),
file("${path.module}/files/install_wsl.ps1")
file("${path.module}/files/install_wsl.ps1"),
file("${path.module}/files/install_scoop.ps1"),
file("${path.module}/files/install_scoop_tools.ps1"),
file("${path.module}/files/enable_features.ps1")
],
var.scripts
) : var.scripts
Expand Down
2 changes: 1 addition & 1 deletion terraform/azure_server/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.56.0"
version = "3.90.0"
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions terraform/azure_server/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
variable "name" {
type = string
description = "The name of the server you would like to provision."

validation {
condition = endswith(var.name, "-server")
error_message = "Name must end with -server"
}
}

variable "replicas" {
Expand Down
4 changes: 4 additions & 0 deletions terraform/internal/azure/vm/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ locals {
</Query>
</QueryList>
"@
# Monitor the initialization scripts. These can take several minutes to complete.
while(1){Get-ScheduledTask -TaskPath "\Rancher\Terraform\"; sleep 5; clear}
EOT
linux = <<-EOT
# Check all stderr logs from initialization scripts
Expand Down
2 changes: 1 addition & 1 deletion terraform/internal/rancher/rke2/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ variable "name" {
variable "kubernetes_version" {
type = string
description = "The version of RKE2 that you would like to use to provision a cluster."
default = "v1.24.13+rke2r1"
default = "v1.29.8+rke2r1"
}

0 comments on commit 287d33f

Please sign in to comment.