Skip to content
Snippets Groups Projects
Commit 0b106e12 authored by Rob Kooper's avatar Rob Kooper
Browse files

update system on install

parent 3849ecf7
No related branches found
No related tags found
No related merge requests found
locals {
cluster_argocd_url = var.argocd_master ? "https://kubernetes.default.svc" : "${var.rancher_url}/k8s/clusters/${var.cluster_kube_id}"
#nfs_path = var.nfs_path == "" ? "/radiant/projects/${var.os_project_name}/${var.cluster_name}" : var.nfs_path
nfs_path = var.nfs_path == "" ? "/radiant/projects/${var.openstack_project}" : var.nfs_path
argocd_cluster = templatefile("${path.module}/templates/cluster.yaml.tmpl", {
......
......@@ -89,7 +89,7 @@ spec:
enabled: ${nfs_enabled}
server: ${nfs_server}
path: ${nfs_path}
pathPattern: "${cluster_name}/$${.PVC.namespace}/$${.PVC.name}"
pathPattern: "${cluster_name}/$${.PVC.namespace}-$${.PVC.name}-$${.PV.name}"
cinder:
enabled: ${cinder_enabled}
......@@ -66,14 +66,14 @@ resource "openstack_networking_port_v2" "worker_ip" {
resource "openstack_networking_port_v2" "floating_ip" {
count = var.floating_ip
depends_on = [ openstack_networking_subnet_v2.cluster_subnet ]
name = format("%s-floating-ip-%03d", var.cluster_name, count.index + 1)
name = format("%s-floating-ip-%02d", var.cluster_name, count.index + 1)
network_id = openstack_networking_network_v2.cluster_net.id
}
# create floating ip that is associated with a fixed ip
resource "openstack_networking_floatingip_v2" "floating_ip" {
count = var.floating_ip
description = format("%s-floating-ip-%03d", var.cluster_name, count.index + 1)
description = format("%s-floating-ip-%02d", var.cluster_name, count.index + 1)
pool = data.openstack_networking_network_v2.ext_net.name
port_id = element(openstack_networking_port_v2.floating_ip.*.id, count.index)
}
......@@ -6,8 +6,8 @@ ssh:
emit_keys_to_console: false
# update and upgrade instance
#package_update: true
#package_upgrade: true
package_update: true
package_upgrade: true
# files to be created on the system
write_files:
......
......@@ -5,9 +5,9 @@ no_ssh_fingerprints: false
ssh:
emit_keys_to_console: false
# update system
#package_update: true
#package_upgrade: true
# update and upgrade instance
package_update: true
package_upgrade: true
# files to be created on the system
write_files:
......
......@@ -8,15 +8,17 @@ variable "cluster_type" {
description = "Cluster type, can be either rke or rke2"
default = "rke2"
validation {
condition = var.cluster_type == "rke" || var.cluster_type == "rke2"
error_message = "Image needs to be one of [rke, rke2]."
#condition = var.cluster_type == "rke" || var.cluster_type == "rke2"
#error_message = "Image needs to be one of [rke, rke2]."
condition = var.cluster_type == "rke2"
error_message = "Currently only support rke2"
}
}
variable "public_key" {
type = string
description = "path to public key to be injected into vm"
#
# leave as create_a_new_key to force a new key
default = "create_a_new_key"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment