Skip to content

Commit

Permalink
feat: Add variable for each charm
Browse files Browse the repository at this point in the history
Adds the channel variable to each charm, allowing us to version them independently
  • Loading branch information
Mark Beierl committed Apr 9, 2024
1 parent 6dffddc commit 40e0252
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 26 deletions.
20 changes: 10 additions & 10 deletions modules/sdcore-control-plane-k8s/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,63 @@ resource "juju_model" "sdcore" {
module "amf" {
source = "git::https://github.com/canonical/sdcore-amf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.amf_channel
config = var.amf_config
}

module "ausf" {
source = "git::https://github.com/canonical/sdcore-ausf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.ausf_channel
}

module "nms" {
source = "git::https://github.com/canonical/sdcore-nms-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nms_channel
}

module "nrf" {
source = "git::https://github.com/canonical/sdcore-nrf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nrf_channel
}

module "nssf" {
source = "git::https://github.com/canonical/sdcore-nssf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nssf_channel
config = var.nssf_config
}

module "pcf" {
source = "git::https://github.com/canonical/sdcore-pcf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.pcf_channel
}

module "smf" {
source = "git::https://github.com/canonical/sdcore-smf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.smf_channel
}

module "udm" {
source = "git::https://github.com/canonical/sdcore-udm-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.udm_channel
}

module "udr" {
source = "git::https://github.com/canonical/sdcore-udr-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.udr_channel
}

module "webui" {
source = "git::https://github.com/canonical/sdcore-webui-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.webui_channel
}

module "mongodb" {
Expand Down
58 changes: 56 additions & 2 deletions modules/sdcore-control-plane-k8s/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,62 @@ variable "create_model" {
default = true
}

variable "channel" {
description = "The channel to use when deploying `SD-Core` charms."
variable "amf_channel" {
description = "The channel to use when deploying `sdcore-amf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "ausf_channel" {
description = "The channel to use when deploying `sdcore-ausf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "nms_channel" {
description = "The channel to use when deploying `sdcore-nms-k8s` charm."
type = string
default = "1.3/edge"
}

variable "nrf_channel" {
description = "The channel to use when deploying `sdcore-nrf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "nssf_channel" {
description = "The channel to use when deploying `sdcore-nssf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "pcf_channel" {
description = "The channel to use when deploying `sdcore-pcf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "smf_channel" {
description = "The channel to use when deploying `sdcore-smf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "udm_channel" {
description = "The channel to use when deploying `sdcore-udm-k8s` charm."
type = string
default = "1.4/edge"
}

variable "udr_channel" {
description = "The channel to use when deploying `sdcore-udr-k8s` charm."
type = string
default = "1.4/edge"
}

variable "webui_channel" {
description = "The channel to use when deploying `sdcore-webui-k8s` charm."
type = string
default = "1.4/edge"
}
Expand Down
20 changes: 10 additions & 10 deletions modules/sdcore-k8s/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,63 @@ resource "juju_model" "sdcore" {
module "amf" {
source = "git::https://github.com/canonical/sdcore-amf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.amf_channel
config = var.amf_config
}

module "ausf" {
source = "git::https://github.com/canonical/sdcore-ausf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.ausf_channel
}

module "nms" {
source = "git::https://github.com/canonical/sdcore-nms-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nms_channel
}

module "nrf" {
source = "git::https://github.com/canonical/sdcore-nrf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nrf_channel
}

module "nssf" {
source = "git::https://github.com/canonical/sdcore-nssf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.nssf_channel
config = var.nssf_config
}

module "pcf" {
source = "git::https://github.com/canonical/sdcore-pcf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.pcf_channel
}

module "smf" {
source = "git::https://github.com/canonical/sdcore-smf-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.smf_channel
}

module "udm" {
source = "git::https://github.com/canonical/sdcore-udm-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.udm_channel
}

module "udr" {
source = "git::https://github.com/canonical/sdcore-udr-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.udr_channel
}

module "webui" {
source = "git::https://github.com/canonical/sdcore-webui-k8s-operator//terraform"
model_name = var.create_model == true ? juju_model.sdcore[0].name : var.model_name
channel = var.channel
channel = var.webui_channel
}

module "mongodb" {
Expand Down
58 changes: 56 additions & 2 deletions modules/sdcore-k8s/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,62 @@ variable "create_model" {
default = true
}

variable "channel" {
description = "The channel to use when deploying `SD-Core` charms."
variable "amf_channel" {
description = "The channel to use when deploying `sdcore-amf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "ausf_channel" {
description = "The channel to use when deploying `sdcore-ausf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "nms_channel" {
description = "The channel to use when deploying `sdcore-nms-k8s` charm."
type = string
default = "1.3/edge"
}

variable "nrf_channel" {
description = "The channel to use when deploying `sdcore-nrf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "nssf_channel" {
description = "The channel to use when deploying `sdcore-nssf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "pcf_channel" {
description = "The channel to use when deploying `sdcore-pcf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "smf_channel" {
description = "The channel to use when deploying `sdcore-smf-k8s` charm."
type = string
default = "1.4/edge"
}

variable "udm_channel" {
description = "The channel to use when deploying `sdcore-udm-k8s` charm."
type = string
default = "1.4/edge"
}

variable "udr_channel" {
description = "The channel to use when deploying `sdcore-udr-k8s` charm."
type = string
default = "1.4/edge"
}

variable "webui_channel" {
description = "The channel to use when deploying `sdcore-webui-k8s` charm."
type = string
default = "1.4/edge"
}
Expand Down
4 changes: 2 additions & 2 deletions modules/sdcore-user-plane-k8s/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ variable "create_model" {
default = true
}

variable "channel" {
description = "The channel to use when deploying `SD-Core` charms."
variable "upf_channel" {
description = "The channel to use when deploying `upf-k8s` charm."
type = string
default = "1.4/edge"
}
Expand Down

0 comments on commit 40e0252

Please sign in to comment.