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

update system on install

parent 3849ecf7
Branches master
No related tags found
No related merge requests found
locals { locals {
cluster_argocd_url = var.argocd_master ? "https://kubernetes.default.svc" : "${var.rancher_url}/k8s/clusters/${var.cluster_kube_id}" 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 nfs_path = var.nfs_path == "" ? "/radiant/projects/${var.openstack_project}" : var.nfs_path
argocd_cluster = templatefile("${path.module}/templates/cluster.yaml.tmpl", { argocd_cluster = templatefile("${path.module}/templates/cluster.yaml.tmpl", {
......
...@@ -89,7 +89,7 @@ spec: ...@@ -89,7 +89,7 @@ spec:
enabled: ${nfs_enabled} enabled: ${nfs_enabled}
server: ${nfs_server} server: ${nfs_server}
path: ${nfs_path} path: ${nfs_path}
pathPattern: "${cluster_name}/$${.PVC.namespace}/$${.PVC.name}" pathPattern: "${cluster_name}/$${.PVC.namespace}-$${.PVC.name}-$${.PV.name}"
cinder: cinder:
enabled: ${cinder_enabled} enabled: ${cinder_enabled}
...@@ -66,14 +66,14 @@ resource "openstack_networking_port_v2" "worker_ip" { ...@@ -66,14 +66,14 @@ resource "openstack_networking_port_v2" "worker_ip" {
resource "openstack_networking_port_v2" "floating_ip" { resource "openstack_networking_port_v2" "floating_ip" {
count = var.floating_ip count = var.floating_ip
depends_on = [ openstack_networking_subnet_v2.cluster_subnet ] 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 network_id = openstack_networking_network_v2.cluster_net.id
} }
# create floating ip that is associated with a fixed ip # create floating ip that is associated with a fixed ip
resource "openstack_networking_floatingip_v2" "floating_ip" { resource "openstack_networking_floatingip_v2" "floating_ip" {
count = var.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 pool = data.openstack_networking_network_v2.ext_net.name
port_id = element(openstack_networking_port_v2.floating_ip.*.id, count.index) port_id = element(openstack_networking_port_v2.floating_ip.*.id, count.index)
} }
...@@ -6,8 +6,8 @@ ssh: ...@@ -6,8 +6,8 @@ ssh:
emit_keys_to_console: false emit_keys_to_console: false
# update and upgrade instance # update and upgrade instance
#package_update: true package_update: true
#package_upgrade: true package_upgrade: true
# files to be created on the system # files to be created on the system
write_files: write_files:
......
...@@ -5,9 +5,9 @@ no_ssh_fingerprints: false ...@@ -5,9 +5,9 @@ no_ssh_fingerprints: false
ssh: ssh:
emit_keys_to_console: false emit_keys_to_console: false
# update system # update and upgrade instance
#package_update: true package_update: true
#package_upgrade: true package_upgrade: true
# files to be created on the system # files to be created on the system
write_files: write_files:
......
...@@ -8,15 +8,17 @@ variable "cluster_type" { ...@@ -8,15 +8,17 @@ variable "cluster_type" {
description = "Cluster type, can be either rke or rke2" description = "Cluster type, can be either rke or rke2"
default = "rke2" default = "rke2"
validation { validation {
condition = var.cluster_type == "rke" || var.cluster_type == "rke2" #condition = var.cluster_type == "rke" || var.cluster_type == "rke2"
error_message = "Image needs to be one of [rke, 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" { variable "public_key" {
type = string type = string
description = "path to public key to be injected into vm" 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" 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