diff --git a/backend_modules/aws/host/main.tf b/backend_modules/aws/host/main.tf index dc757c5cc..9a7026923 100644 --- a/backend_modules/aws/host/main.tf +++ b/backend_modules/aws/host/main.tf @@ -33,6 +33,7 @@ locals { overwrite_fqdn = local.route53_domain == null ? local.provider_settings["overwrite_fqdn"] : "${var.base_configuration["name_prefix"]}${var.name}.${var.base_configuration["route53_domain"]}" route53_zone_id = lookup(var.base_configuration, "route53_zone_id", null) route53_domain = lookup(var.base_configuration, "route53_domain", null) + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] resource_name_prefix = "${var.base_configuration["name_prefix"]}${var.name}" @@ -245,6 +246,7 @@ resource "null_resource" "host_salt_configuration" { use_ntp = var.base_configuration["use_ntp"] testsuite = var.base_configuration["testsuite"] roles = var.roles + product_version = local.product_version use_os_released_updates = var.use_os_released_updates additional_repos = var.additional_repos additional_repos_only = var.additional_repos_only diff --git a/backend_modules/azure/host/main.tf b/backend_modules/azure/host/main.tf index b24a7f86f..9098db56a 100644 --- a/backend_modules/azure/host/main.tf +++ b/backend_modules/azure/host/main.tf @@ -25,10 +25,11 @@ locals { public_security_group_id = var.base_configuration.public_security_group_id private_security_group_id = var.base_configuration.private_security_group_id private_additional_security_group_id = var.base_configuration.private_additional_security_group_id - resource_group_name = var.base_configuration.resource_group_name - resource_name_prefix = "${var.base_configuration["name_prefix"]}${var.name}" - public_instance = lookup(var.provider_settings, "public_instance", false) - location = var.base_configuration["location"] + resource_group_name = var.base_configuration.resource_group_name + resource_name_prefix = "${var.base_configuration["name_prefix"]}${var.name}" + public_instance = lookup(var.provider_settings, "public_instance", false) + location = var.base_configuration["location"] + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] } data "template_file" "user_data" { @@ -181,6 +182,7 @@ resource "azurerm_virtual_machine_data_disk_attachment" "addtionaldisks-attach" use_ntp = var.base_configuration["use_ntp"] testsuite = var.base_configuration["testsuite"] roles = var.roles + product_version = local.product_version use_os_released_updates = var.use_os_released_updates additional_repos = var.additional_repos additional_repos_only = var.additional_repos_only diff --git a/backend_modules/feilong/host/main.tf b/backend_modules/feilong/host/main.tf index cef1181f0..23a31b162 100644 --- a/backend_modules/feilong/host/main.tf +++ b/backend_modules/feilong/host/main.tf @@ -2,6 +2,7 @@ locals { name_prefix = var.base_configuration["name_prefix"] domain = var.base_configuration["domain"] ssh_key_path = var.base_configuration["ssh_key_path"] + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] provider_settings = merge({ userid = null memory = "2G" @@ -61,7 +62,7 @@ resource "null_resource" "provisioning" { use_avahi = false provider = "feilong" roles = var.roles - product_version = var.product_version + product_version = local.product_version use_os_released_updates = var.use_os_released_updates additional_repos = var.additional_repos additional_repos_only = var.additional_repos_only diff --git a/backend_modules/libvirt/base/main.tf b/backend_modules/libvirt/base/main.tf index f8ce9ef0a..86eb6a2eb 100644 --- a/backend_modules/libvirt/base/main.tf +++ b/backend_modules/libvirt/base/main.tf @@ -75,9 +75,9 @@ output "configuration" { additional_network = local.additional_network additional_network_id = join(",", libvirt_network.additional_network.*.id) - pool = local.pool - network_name = local.bridge == null ? local.network_name : null - bridge = local.bridge + pool = local.pool + network_name = local.bridge == null ? local.network_name : null + bridge = local.bridge bastion_host = lookup(var.provider_settings, "bastion_host", null) bastion_host_key = lookup(var.provider_settings, "bastion_host_key", null) bastion_port = lookup(var.provider_settings, "bastion_port", null) diff --git a/backend_modules/libvirt/host/main.tf b/backend_modules/libvirt/host/main.tf index fa3ecdf0a..956c651be 100644 --- a/backend_modules/libvirt/host/main.tf +++ b/backend_modules/libvirt/host/main.tf @@ -15,7 +15,7 @@ locals { } ] container_runtime = lookup(var.grains, "container_runtime", "") - product_version = lookup(var.grains, "product_version", "") + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] combustion = contains(local.combustion_images, var.image) provider_settings = merge({ @@ -298,6 +298,7 @@ resource "null_resource" "provisioning" { additional_certs = var.additional_certs additional_packages = var.additional_packages swap_file_size = var.swap_file_size + product_version = local.product_version authorized_keys = concat( var.base_configuration["ssh_key_path"] != null ? [trimspace(file(var.base_configuration["ssh_key_path"]))] : [], var.ssh_key_path != null ? [trimspace(file(var.ssh_key_path))] : [], diff --git a/backend_modules/null/base/main.tf b/backend_modules/null/base/main.tf index 5583093cb..51bde6c12 100644 --- a/backend_modules/null/base/main.tf +++ b/backend_modules/null/base/main.tf @@ -4,6 +4,7 @@ resource "null_resource" "base" { triggers = { cc_username = var.cc_username cc_password = var.cc_password + product_version = var.product_version timezone = var.timezone use_ntp = var.use_ntp ssh_key_path = var.ssh_key_path @@ -33,5 +34,6 @@ output "configuration" { name_prefix = var.name_prefix use_shared_resources = var.use_shared_resources testsuite = var.testsuite + product_version = var.product_version } } diff --git a/backend_modules/null/base/variables.tf b/backend_modules/null/base/variables.tf index f6f661e25..4af80b6b9 100644 --- a/backend_modules/null/base/variables.tf +++ b/backend_modules/null/base/variables.tf @@ -82,3 +82,8 @@ variable "is_server_paygo_instance" { type = bool default = false } + +variable "product_version" { + description = "One of: 4.3-nightly, 4.3-released, 4.3-pr, 4.3-beta, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string +} diff --git a/backend_modules/null/host/variables.tf b/backend_modules/null/host/variables.tf index bfa1e0ef6..d0a83f216 100644 --- a/backend_modules/null/host/variables.tf +++ b/backend_modules/null/host/variables.tf @@ -127,7 +127,7 @@ variable "volume_provider_settings" { } variable "product_version" { - description = "One of: 4.3-nightly, 4.3-released, 4.3-pr, 4.3-beta, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string - default = "5.0-released" + default = null } diff --git a/backend_modules/ssh/host/main.tf b/backend_modules/ssh/host/main.tf index 34e9db747..31e703798 100644 --- a/backend_modules/ssh/host/main.tf +++ b/backend_modules/ssh/host/main.tf @@ -1,7 +1,7 @@ locals { resource_name_prefix = "${var.base_configuration["name_prefix"]}${var.name}" - - provider_settings = merge({ + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] + provider_settings = merge({ host = null user = "root" password = "linux" @@ -85,6 +85,7 @@ resource "null_resource" "provisioning" { timezone = var.base_configuration["timezone"] use_ntp = var.base_configuration["use_ntp"] testsuite = var.base_configuration["testsuite"] + product_version = local.product_version roles = var.roles use_os_released_updates = var.use_os_released_updates install_salt_bundle = var.install_salt_bundle diff --git a/main.tf.aws-create-mirror-snapshot.example b/main.tf.aws-create-mirror-snapshot.example index 9d5de91a6..97500ff5b 100644 --- a/main.tf.aws-create-mirror-snapshot.example +++ b/main.tf.aws-create-mirror-snapshot.example @@ -20,6 +20,7 @@ locals { name_prefix = "mirrorsnap-" region = "eu-west-2" availability_zone = "${local.region}a" + product_version = "5.0-released" ssh_allowed_ips = [""] // add your IP address in here } @@ -36,6 +37,7 @@ module "base" { cc_password = local.cc_password name_prefix = local.name_prefix + product_version = local.product_version provider_settings = { availability_zone = local.availability_zone diff --git a/main.tf.aws.example b/main.tf.aws.example index ba83dfb92..3f154ef9c 100644 --- a/main.tf.aws.example +++ b/main.tf.aws.example @@ -18,6 +18,7 @@ module "base" { cc_password = ... name_prefix = ... // if you use name_prefix, make sure to update the server_configuration for clients/minions below + product_version = "uyuni-release" provider_settings = { availability_zone = local.availability_zone @@ -67,7 +68,6 @@ module "server" { name = "server" image = "opensuse154o" - product_version = "uyuni-release" provider_settings = { } } @@ -79,7 +79,6 @@ module "minion" { name = "minion" image = "opensuse154o" server_configuration = module.server.configuration - product_version = "uyuni-release" } output "key_file" { diff --git a/main.tf.azure.example b/main.tf.azure.example index 819f23816..de6e07c6a 100644 --- a/main.tf.azure.example +++ b/main.tf.azure.example @@ -17,7 +17,7 @@ module "base" { name_prefix = local.name_prefix // if you use name_prefix, make sure to update the server_configuration for clients/minions below - + product_version = "uyuni-release" provider_settings = { location = local.location ssh_allowed_ips = "*" @@ -65,7 +65,6 @@ module "server" { name = "server" image = "suma41" - product_version = "suma41" provider_settings = { @@ -82,7 +81,6 @@ module "minion" { name = "minion" image = "opensuse154" server_configuration = module.server.configuration - product_version = "uyuni-release" } output "key_file" { diff --git a/main.tf.libvirt.example b/main.tf.libvirt.example index 55ba6c751..ae98dab40 100644 --- a/main.tf.libvirt.example +++ b/main.tf.libvirt.example @@ -18,6 +18,7 @@ module "base" { // Set SUSE Customer Center credentials here if you have some // cc_username = "" // cc_password = "" + product_version = "uyuni-master" // optional parameters with defaults below // use_avahi = true @@ -40,7 +41,6 @@ module "server" { base_configuration = module.base.configuration name = "server" - product_version = "uyuni-master" // see modules/server_containerized/variables.tf for possible values // connect_to_additional_network = true @@ -66,6 +66,5 @@ module "minion" { name = "minion" image = "opensuse155o" server_configuration = module.server.configuration - product_version = module.server.configuration.product_version // see modules/minion/variables.tf for possible values } diff --git a/main.tf.libvirt.example.Manager-43 b/main.tf.libvirt.example.Manager-43 index ab857b952..bd4bc0989 100644 --- a/main.tf.libvirt.example.Manager-43 +++ b/main.tf.libvirt.example.Manager-43 @@ -18,6 +18,7 @@ module "base" { // Set SUSE Customer Center credentials here if you have some // cc_username = "" // cc_password = "" + product_version = "4.3-nightly" // optional parameters with defaults below // use_avahi = true @@ -40,7 +41,6 @@ module "server" { base_configuration = module.base.configuration name = "server" - product_version = "4.3-nightly" // see modules/server_containerized/variables.tf for possible values // connect_to_additional_network = true @@ -54,6 +54,5 @@ module "minion" { name = "minion" image = "sles15sp4o" server_configuration = module.server.configuration - product_version = module.server.configuration.product_version // see modules/minion/variables.tf for possible values } diff --git a/main.tf.ssh.example b/main.tf.ssh.example index 9343a6bb3..e80533d0b 100644 --- a/main.tf.ssh.example +++ b/main.tf.ssh.example @@ -3,6 +3,7 @@ module "base" { cc_username = "UC7" cc_password = ... + product_version = "4.3-nightly" // optional parameters with defaults below // use_avahi = true @@ -20,7 +21,6 @@ module "server" { base_configuration = module.base.configuration name = "server" - product_version = "4.3-nightly" // see modules/suse_manager/variables.tf for possible values // connect_to_additional_network = true diff --git a/modules/base/main.tf b/modules/base/main.tf index 08f0baaf4..fd8230e31 100644 --- a/modules/base/main.tf +++ b/modules/base/main.tf @@ -3,6 +3,7 @@ module "base_backend" { cc_username = var.cc_username cc_password = var.cc_password + product_version = var.product_version timezone = var.timezone use_ntp = var.use_ntp ssh_key_path = var.ssh_key_path @@ -23,6 +24,7 @@ output "configuration" { value = merge({ cc_username = var.cc_username cc_password = var.cc_password + product_version = var.product_version timezone = var.timezone use_ntp = var.use_ntp ssh_key_path = var.ssh_key_path diff --git a/modules/build_host/main.tf b/modules/build_host/main.tf index 6074f7832..6b43405a5 100644 --- a/modules/build_host/main.tf +++ b/modules/build_host/main.tf @@ -18,15 +18,13 @@ module "build_host" { roles = ["build_host"] disable_firewall = var.disable_firewall grains = { - product_version = var.product_version - mirror = var.base_configuration["mirror"] + mirror = var.base_configuration["mirror"] server = var.server_configuration["hostname"] auto_connect_to_master = var.auto_connect_to_master avahi_reflector = var.avahi_reflector sles_registration_code = var.sles_registration_code } - image = var.image provider_settings = var.provider_settings } diff --git a/modules/build_host/variables.tf b/modules/build_host/variables.tf index 74aa0c86a..178ef9942 100644 --- a/modules/build_host/variables.tf +++ b/modules/build_host/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly, head) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } variable "server_configuration" { diff --git a/modules/client/main.tf b/modules/client/main.tf index ba0963ee2..7d37c199f 100644 --- a/modules/client/main.tf +++ b/modules/client/main.tf @@ -17,8 +17,8 @@ module "client" { connect_to_additional_network = false roles = ["client"] disable_firewall = var.disable_firewall + product_version = var.product_version grains = { - product_version = var.product_version mirror = var.base_configuration["mirror"] server = var.server_configuration["hostname"] auto_register = var.auto_register diff --git a/modules/client/variables.tf b/modules/client/variables.tf index bfd224f11..257bd6065 100644 --- a/modules/client/variables.tf +++ b/modules/client/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } variable "server_configuration" { diff --git a/modules/controller/main.tf b/modules/controller/main.tf index b3d75d7d0..57ed2dbe6 100644 --- a/modules/controller/main.tf +++ b/modules/controller/main.tf @@ -29,15 +29,15 @@ module "controller" { connect_to_base_network = true connect_to_additional_network = false roles = ["controller"] + product_version = var.product_version grains = { cc_username = var.base_configuration["cc_username"] cc_password = var.base_configuration["cc_password"] git_username = var.git_username git_password = var.git_password git_repo = var.git_repo - branch = var.branch == "default" ? var.testsuite-branch[var.server_configuration["product_version"]] : var.branch + branch = var.branch == "default" ? var.testsuite-branch[var.base_configuration["product_version"]] : var.branch mirror = var.no_mirror == true ? null : var.base_configuration["mirror"] - product_version = var.product_version server = var.server_configuration["hostname"] proxy = var.proxy_configuration["hostname"] diff --git a/modules/controller/variables.tf b/modules/controller/variables.tf index a7fe805c1..370e0b4d1 100644 --- a/modules/controller/variables.tf +++ b/modules/controller/variables.tf @@ -757,6 +757,7 @@ variable "server_instance_id" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly, head) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } diff --git a/modules/cucumber_testsuite/main.tf b/modules/cucumber_testsuite/main.tf index c0f007e85..94209710a 100644 --- a/modules/cucumber_testsuite/main.tf +++ b/modules/cucumber_testsuite/main.tf @@ -12,6 +12,7 @@ module "base" { use_mirror_images = var.use_mirror_images use_shared_resources = var.use_shared_resources ssh_key_path = var.ssh_key_path + product_version = var.product_version testsuite = true provider_settings = var.provider_settings @@ -86,7 +87,6 @@ module "server" { count = var.container_server ? 0 : 1 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "server", "default") name = lookup(local.names, "server", "srv") auto_accept = false @@ -131,7 +131,6 @@ module "server_containerized" { count = var.container_server ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "server_containerized", "default") name = lookup(local.names, "server_containerized", "srv") runtime = lookup(local.runtimes, "server_containerized", "podman") @@ -175,7 +174,6 @@ module "proxy" { quantity = contains(local.hosts, "proxy") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "proxy", "default") name = lookup(local.names, "proxy", "pxy") @@ -206,7 +204,6 @@ module "proxy_containerized" { quantity = contains(local.hosts, "proxy_containerized") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "proxy_containerized", "default") name = lookup(local.names, "proxy_containerized", "pxy") @@ -251,7 +248,6 @@ module "suse-client" { quantity = contains(local.hosts, "suse-client") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "suse-client", "sles15sp4o") name = lookup(local.names, "suse-client", "cli-sles15") @@ -274,7 +270,6 @@ module "suse-minion" { quantity = contains(local.hosts, "suse-minion") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "suse-minion", "sles15sp4o") name = lookup(local.names, "suse-minion", "min-sles15") @@ -299,7 +294,6 @@ module "suse-sshminion" { quantity = contains(local.hosts, "suse-sshminion") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "suse-sshminion", "sles15sp4o") name = lookup(local.names, "suse-sshminion", "minssh-sles15") sles_registration_code = lookup(local.sles_registration_code, "suse-sshminion", null) @@ -320,7 +314,6 @@ module "slemicro-minion" { quantity = contains(local.hosts, "slemicro-minion") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "slemicro-minion", "slemicro55o") name = lookup(local.names, "slemicro-minion", "min-slemicro5") @@ -344,7 +337,6 @@ module "redhat-minion" { quantity = contains(local.hosts, "redhat-minion") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "redhat-minion", "rocky8o") name = lookup(local.names, "redhat-minion", "min-rocky8") @@ -367,7 +359,6 @@ module "debian-minion" { quantity = contains(local.hosts, "debian-minion") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "debian-minion", "ubuntu2204o") name = lookup(local.names, "debian-minion", "min-ubuntu2204") @@ -389,7 +380,6 @@ module "build-host" { quantity = contains(local.hosts, "build-host") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "build-host", "sles15sp4o") name = lookup(local.names, "build-host", "min-build") @@ -427,7 +417,6 @@ module "kvm-host" { quantity = contains(local.hosts, "kvm-host") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "kvm-host", "sles15sp4o") name = lookup(local.names, "kvm-host", "min-kvm") @@ -452,7 +441,6 @@ module "monitoring-server" { quantity = contains(local.hosts, "monitoring-server") ? 1 : 0 base_configuration = module.base.configuration - product_version = var.product_version image = lookup(local.images, "monitoring-server", "sles15sp4o") name = lookup(local.names, "monitoring-server", "min-monitoring") @@ -501,7 +489,6 @@ module "controller" { server_http_proxy = var.server_http_proxy custom_download_endpoint = var.custom_download_endpoint swap_file_size = null - product_version = var.product_version additional_repos = lookup(local.additional_repos, "controller", {}) additional_repos_only = lookup(local.additional_repos_only, "controller", false) diff --git a/modules/cucumber_testsuite/variables.tf b/modules/cucumber_testsuite/variables.tf index 599d62bf9..e432fb0bd 100644 --- a/modules/cucumber_testsuite/variables.tf +++ b/modules/cucumber_testsuite/variables.tf @@ -84,8 +84,9 @@ variable "host_settings" { // server variable "product_version" { - description = "One of: 4.3-nightly, 4.3-released, 4.3-pr, 4.3-beta, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string + default = null } variable "from_email" { diff --git a/modules/minion/main.tf b/modules/minion/main.tf index b55b0c1d5..02fce1a95 100644 --- a/modules/minion/main.tf +++ b/modules/minion/main.tf @@ -17,9 +17,8 @@ module "minion" { connect_to_additional_network = false roles = var.roles disable_firewall = var.disable_firewall - + product_version = var.product_version grains = merge({ - product_version = var.product_version mirror = var.base_configuration["mirror"] server = var.server_configuration["hostname"] auto_connect_to_master = var.auto_connect_to_master diff --git a/modules/minion/variables.tf b/modules/minion/variables.tf index 4df4e2db4..a84c84570 100644 --- a/modules/minion/variables.tf +++ b/modules/minion/variables.tf @@ -13,8 +13,9 @@ variable "roles" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly, head) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } variable "server_configuration" { diff --git a/modules/proxy/main.tf b/modules/proxy/main.tf index 709f869f8..8ede9d434 100644 --- a/modules/proxy/main.tf +++ b/modules/proxy/main.tf @@ -14,6 +14,10 @@ variable "images" { } } +locals { + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] +} + module "proxy" { source = "../host" @@ -33,8 +37,8 @@ module "proxy" { connect_to_additional_network = true roles = ["proxy"] disable_firewall = var.disable_firewall + product_version = var.product_version grains = { - product_version = var.product_version mirror = var.base_configuration["mirror"] server = var.server_configuration["hostname"] minion = var.minion @@ -54,7 +58,7 @@ module "proxy" { proxy_containerized = var.proxy_containerized } - image = var.image == "default" ? var.images[var.product_version] : var.image + image = var.image == "default" ? var.images[local.product_version] : var.image provider_settings = var.provider_settings additional_disk_size = var.repository_disk_size volume_provider_settings = var.volume_provider_settings @@ -67,7 +71,6 @@ output "configuration" { private_mac = length(module.proxy.configuration["private_macs"]) > 0 ? module.proxy.configuration["private_macs"][0]: null private_ip = 254 private_name = "proxy" - product_version = var.product_version username = var.server_configuration["username"] password = var.server_configuration["password"] } diff --git a/modules/proxy/variables.tf b/modules/proxy/variables.tf index f13be4482..62fe65663 100644 --- a/modules/proxy/variables.tf +++ b/modules/proxy/variables.tf @@ -10,6 +10,7 @@ variable "name" { variable "product_version" { description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string + default = null } variable "server_configuration" { diff --git a/modules/proxy_containerized/main.tf b/modules/proxy_containerized/main.tf index d5373717b..61074a592 100644 --- a/modules/proxy_containerized/main.tf +++ b/modules/proxy_containerized/main.tf @@ -9,6 +9,10 @@ variable "images" { } } +locals { + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] +} + module "proxy_containerized" { source = "../host" @@ -17,7 +21,7 @@ module "proxy_containerized" { connect_to_additional_network = true quantity = var.quantity base_configuration = var.base_configuration - image = var.image == "default" || var.product_version == "head" ? var.images[var.product_version] : var.image + image = var.image == "default" || local.product_version == "head" ? var.images[local.product_version] : var.image name = var.name use_os_released_updates = true install_salt_bundle = var.install_salt_bundle @@ -31,7 +35,6 @@ module "proxy_containerized" { volume_provider_settings = var.volume_provider_settings grains = { - product_version = var.product_version server = var.server_configuration["hostname"] server_username = var.server_configuration["username"] server_password = var.server_configuration["password"] @@ -55,7 +58,6 @@ output "configuration" { private_mac = length(module.proxy_containerized.configuration["private_macs"]) > 0 ? module.proxy_containerized.configuration["private_macs"][0]: null private_ip = 254 private_name = "proxy" - product_version = var.product_version username = var.server_configuration["username"] password = var.server_configuration["password"] runtime = var.runtime diff --git a/modules/proxy_containerized/variables.tf b/modules/proxy_containerized/variables.tf index c8a5511d3..1fe0ef416 100644 --- a/modules/proxy_containerized/variables.tf +++ b/modules/proxy_containerized/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "One of: head, uyuni-master, uyuni-released, uyuni-pr" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string + default = null } variable "runtime" { diff --git a/modules/server/main.tf b/modules/server/main.tf index da48320ea..b589833a3 100644 --- a/modules/server/main.tf +++ b/modules/server/main.tf @@ -15,6 +15,10 @@ variable "images" { } } +locals { + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] +} + module "server" { source = "../host" @@ -35,7 +39,7 @@ module "server" { connect_to_additional_network = false roles = var.register_to_server == null ? ["server"] : ["server", "minion"] disable_firewall = var.disable_firewall - image = var.image == "default" ? var.images[var.product_version] : var.image + image = var.image == "default" ? var.images[local.product_version] : var.image provider_settings = var.provider_settings main_disk_size = var.main_disk_size additional_disk_size = var.repository_disk_size @@ -43,7 +47,6 @@ module "server" { volume_provider_settings = var.volume_provider_settings grains = { - product_version = var.product_version cc_username = var.base_configuration["cc_username"] cc_password = var.base_configuration["cc_password"] channels = var.channels @@ -104,7 +107,6 @@ output "configuration" { value = { id = length(module.server.configuration["ids"]) > 0 ? module.server.configuration["ids"][0] : null hostname = length(module.server.configuration["hostnames"]) > 0 ? module.server.configuration["hostnames"][0] : null - product_version = var.product_version username = var.server_username password = var.server_password } diff --git a/modules/server/variables.tf b/modules/server/variables.tf index ec8d1fa90..7059137e0 100644 --- a/modules/server/variables.tf +++ b/modules/server/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-paygo, 4.3-VM-nightly, 4.3-VM-released, 5.0-released, 5.0-nightly, head, uyuni-master, uyuni-released, uyuni-pr" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string + default = null } variable "channels" { diff --git a/modules/server_containerized/main.tf b/modules/server_containerized/main.tf index ad9f49a02..b129e461d 100644 --- a/modules/server_containerized/main.tf +++ b/modules/server_containerized/main.tf @@ -11,6 +11,10 @@ variable "images" { } } +locals { + product_version = var.product_version != null ? var.product_version : var.base_configuration["product_version"] +} + module "server_containerized" { source = "../host" @@ -30,7 +34,7 @@ module "server_containerized" { ipv6 = var.ipv6 connect_to_base_network = true connect_to_additional_network = false - image = var.image == "default" ? var.images[var.product_version] : var.image + image = var.image == "default" ? var.images[local.product_version] : var.image provision = var.provision provider_settings = var.provider_settings main_disk_size = var.main_disk_size @@ -39,7 +43,6 @@ module "server_containerized" { volume_provider_settings = var.volume_provider_settings grains = { - product_version = var.product_version container_runtime = var.runtime container_repository = var.container_repository container_tag = var.container_tag @@ -77,7 +80,6 @@ output "configuration" { value = { id = length(module.server_containerized.configuration["ids"]) > 0 ? module.server_containerized.configuration["ids"][0] : null hostname = length(module.server_containerized.configuration["hostnames"]) > 0 ? module.server_containerized.configuration["hostnames"][0] : null - product_version = var.product_version username = var.server_username password = var.server_password runtime = var.runtime diff --git a/modules/server_containerized/variables.tf b/modules/server_containerized/variables.tf index 55c650b28..309cd2a26 100644 --- a/modules/server_containerized/variables.tf +++ b/modules/server_containerized/variables.tf @@ -33,8 +33,9 @@ variable "helm_chart_url" { } variable "product_version" { - description = "One of: uyuni-master, uyuni-released, head, uyuni-pr" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" type = string + default = null } variable "channels" { diff --git a/modules/sshminion/main.tf b/modules/sshminion/main.tf index bb20bf34c..18c2f834d 100644 --- a/modules/sshminion/main.tf +++ b/modules/sshminion/main.tf @@ -18,8 +18,7 @@ module "sshminion" { roles = ["sshminion"] disable_firewall = var.disable_firewall grains = { - product_version = var.product_version - mirror = var.base_configuration["mirror"] + mirror = var.base_configuration["mirror"] auto_connect_to_master = var.auto_connect_to_master sles_registration_code = var.sles_registration_code } diff --git a/modules/sshminion/variables.tf b/modules/sshminion/variables.tf index 13a633ec6..e6a65fe67 100644 --- a/modules/sshminion/variables.tf +++ b/modules/sshminion/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly, head) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } variable "auto_connect_to_master" { diff --git a/modules/virthost/variables.tf b/modules/virthost/variables.tf index 5cf3036e5..4e83eb041 100644 --- a/modules/virthost/variables.tf +++ b/modules/virthost/variables.tf @@ -8,8 +8,9 @@ variable "name" { } variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.3-nightly, head) see README_ADVANCED.md" - default = "released" + description = "One of: 4.3-released, 4.3-nightly, 4.3-pr, 4.3-beta, 4.3-build_image, 4.3-VM-nightly, 4.3-VM-released, 5.0-nightly, 5.0-released, head, uyuni-master, uyuni-released, uyuni-pr" + type = string + default = null } variable "server_configuration" {