From f10bcc656c6f701983e9699d62c5312f55426c81 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Tue, 14 May 2024 12:20:30 +0100 Subject: [PATCH] Fix sysconfig charm rev, add allocation ratios to nova-compute and add dashboard --- juju/home-maas/00-variables.tf | 2 +- juju/home-maas/06-nova-compute.tf | 2 + juju/home-maas/06-openstack-dashboard.tf | 145 +++++++++++++++++++++++ 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 juju/home-maas/06-openstack-dashboard.tf diff --git a/juju/home-maas/00-variables.tf b/juju/home-maas/00-variables.tf index f066b15..432141e 100644 --- a/juju/home-maas/00-variables.tf +++ b/juju/home-maas/00-variables.tf @@ -101,7 +101,7 @@ variable "sysconfig_channel" { variable "sysconfig_revision" { type = string - default = "19" + default = "22" } variable "ubuntu_channel" { diff --git a/juju/home-maas/06-nova-compute.tf b/juju/home-maas/06-nova-compute.tf index 7af4f94..9f34abc 100644 --- a/juju/home-maas/06-nova-compute.tf +++ b/juju/home-maas/06-nova-compute.tf @@ -34,6 +34,8 @@ resource "juju_application" "nova-compute-kvm" { virt-type = "kvm" customize-failure-domain = var.customize-failure-domain reserved-host-memory = var.reserved-host-memory + cpu-allocation-ratio = var.cpu-allocation-ratio + ram-allocation-ratio = var.ram-allocation-ratio #cpu-mode = "custom" #cpu-model = "EPYC-IBPB" #cpu-model-extra-flags = "svm,pcid" diff --git a/juju/home-maas/06-openstack-dashboard.tf b/juju/home-maas/06-openstack-dashboard.tf new file mode 100644 index 0000000..ed3eb3c --- /dev/null +++ b/juju/home-maas/06-openstack-dashboard.tf @@ -0,0 +1,145 @@ +resource "juju_machine" "openstack-dashboard" { + count = var.num_units + model = var.model-name + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index]].machine_id]) + constraints = "spaces=oam,ceph-access" +} + +resource "juju_application" "openstack-dashboard" { + name = "openstack-dashboard" + + model = var.model-name + + charm { + name = "openstack-dashboard" + channel = var.openstack-channel + } + + units = var.num_units + + placement = "${join(",", sort([ + for res in juju_machine.openstack-dashboard : + res.machine_id + ]))}" + + endpoint_bindings = [{ + space = var.oam-space + },{ + endpoint = "shared-db" + space = var.internal-space + }] + + config = { + openstack-origin = var.openstack-origin + vip = var.vips["dashboard"] + webroot = "/" + secret = "encryptcookieswithme" + cinder-backup = "false" + password-retrieve = "true" + endpoint-type = "publicURL" + + neutron-network-l3ha = "true" + neutron-network-lb = "true" + neutron-network-firewall = "false" + } +} + +resource "juju_application" "openstack-dashboard-mysql-router" { + name = "openstack-dashboard-mysql-router" + + model = var.model-name + + charm { + name = "mysql-router" + channel = var.mysql-router-channel + } + + units = 0 + + endpoint_bindings = [{ + space = var.oam-space + },{ + space = var.internal-space + endpoint = "shared-db" + },{ + space = var.internal-space + endpoint = "db-router" + }] + + config = { + source = var.openstack-origin + } +} + +resource "juju_application" "hacluster-openstack-dashboard" { + name = "hacluster-openstack-dashboard" + + model = var.model-name + + charm { + name = "hacluster" + channel = var.hacluster-channel + } + + units = 0 +} + +resource "juju_integration" "openstack-dashboard-ha" { + + model = var.model-name + + application { + name = juju_application.openstack-dashboard.name + endpoint = "ha" + } + + application { + name = juju_application.hacluster-openstack-dashboard.name + endpoint = "ha" + } +} + +resource "juju_integration" "openstack-dashboard-mysql" { + + model = var.model-name + + application { + name = juju_application.openstack-dashboard.name + endpoint = "shared-db" + } + + application { + name = juju_application.openstack-dashboard-mysql-router.name + endpoint = "shared-db" + } +} + +resource "juju_integration" "openstack-dashboard-db" { + + model = var.model-name + + application { + name = juju_application.openstack-dashboard-mysql-router.name + endpoint = "db-router" + } + + application { + name = juju_application.mysql-innodb-cluster.name + endpoint = "db-router" + } +} + +resource "juju_integration" "openstack-dashboard-keystone" { + + model = var.model-name + + application { + name = juju_application.openstack-dashboard.name + endpoint = "identity-service" + } + + application { + name = juju_application.keystone.name + endpoint = "identity-service" + } +}