Skip to content

Commit e157ced

Browse files
committed
fix: comments
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent 36c7d84 commit e157ced

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

modules/deploy/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ locals {
5151

5252
resource "file_local_directory" "deploy_path" {
5353
path = local.deploy_path
54-
permissions = "0775"
54+
permissions = "0755"
5555
}
5656

5757
resource "file_local_directory" "tf_data_dir" {
@@ -60,7 +60,7 @@ resource "file_local_directory" "tf_data_dir" {
6060
]
6161
count = (local.tf_data_dir != local.deploy_path ? 1 : 0)
6262
path = local.tf_data_dir
63-
permissions = "0775"
63+
permissions = "0755"
6464
}
6565

6666
### Template Files ###
@@ -200,7 +200,7 @@ resource "file_local" "generate_files" {
200200
directory = dirname("${local.deploy_path}/${each.key}")
201201
name = basename(each.key)
202202
contents = each.value
203-
permissions = "0644"
203+
permissions = "0600"
204204
}
205205

206206
## Deploy ##

modules/install_rancher/rancher/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ resource "terraform_data" "wait_for_certificate_secret" {
219219
}
220220

221221

222-
# The Helm resource completes in less than 10 seconds
223-
# at which time the tls-rancher-ingress secret is generated
222+
# Wait for the tls-rancher-ingress secret to be generated by the Helm release
224223
data "kubernetes_secret_v1" "certificate" {
225224
depends_on = [
226225
time_sleep.settle_before_rancher,

modules/install_rancher/rancher/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ variable "rke2_version" {
2323
The version of rke2 powering the cluster.
2424
This is used for determining ingress configuration.
2525
EOT
26+
validation {
27+
condition = can(regex("^v\\d+\\.\\d+\\.\\d+\\+rke2r\\d+$", var.rke2_version))
28+
error_message = "The rke2_version must match the format vX.Y.Z+rke2rN (eg. v1.34.7+rke2r1)."
29+
}
2630
}
2731
variable "rancher_helm_repo" {
2832
type = string

modules/install_rancher/rancher_externalTLS/variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ variable "rke2_version" {
2323
The version of rke2 powering the cluster.
2424
This is used for determining ingress configuration.
2525
EOT
26+
validation {
27+
condition = can(regex("^v?[0-9]+\\.[0-9]+\\.[0-9]+.*$", var.rke2_version))
28+
error_message = "The rke2_version must be a valid version string, e.g., 'v1.28.4+rke2r1'."
29+
}
2630
}
2731
variable "rancher_helm_repo" {
2832
type = string
@@ -67,7 +71,7 @@ variable "rancher_helm_chart_values" {
6771
"agentTLSMode" : "system-store"
6872
}
6973
EOT
70-
default = "{}"
74+
default = "e30="
7175
sensitive = true
7276
}
7377
variable "ca_certs" {

modules/install_rancher/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ variable "rke2_version" {
5050
The version of rke2 powering the cluster.
5151
This is used for determining ingress configuration.
5252
EOT
53+
validation {
54+
condition = can(regex("^v?[0-9]+\\.[0-9]+\\.[0-9]+.*$", var.rke2_version))
55+
error_message = "The rke2_version must be a valid version string, e.g., 'v1.28.4+rke2r1'."
56+
}
5357
}
5458
variable "rancher_helm_repo" {
5559
type = string

0 commit comments

Comments
 (0)