From c78183b97448e97da89853612eb81c67f7339eee Mon Sep 17 00:00:00 2001 From: vandabarata Date: Mon, 28 Nov 2022 21:14:02 +0000 Subject: [PATCH] QE: Change grafana module to remove hardcoded values --- modules/grafana/main.tf | 4 +- modules/grafana/variables.tf | 10 ++ modules/monitoring_server/main.tf | 37 ------- modules/monitoring_server/variables.tf | 120 ----------------------- modules/monitoring_server/versions.tf | 13 --- salt/monitoring_server/certs/ca.cert.pem | 35 ------- salt/monitoring_server/init.sls | 14 --- 7 files changed, 12 insertions(+), 221 deletions(-) delete mode 100644 modules/monitoring_server/main.tf delete mode 100644 modules/monitoring_server/variables.tf delete mode 100644 modules/monitoring_server/versions.tf delete mode 100644 salt/monitoring_server/certs/ca.cert.pem delete mode 100644 salt/monitoring_server/init.sls diff --git a/modules/grafana/main.tf b/modules/grafana/main.tf index 9971c9e65..95cb72dda 100644 --- a/modules/grafana/main.tf +++ b/modules/grafana/main.tf @@ -10,10 +10,10 @@ module "grafana" { mirror = var.base_configuration["mirror"] server = var.server_configuration["hostname"] locust = var.locust_configuration["hostname"] - product_version = "4.2-nightly" + product_version = var.product_version } - image = "sles12sp5" + image = var.image provider_settings = var.provider_settings } diff --git a/modules/grafana/variables.tf b/modules/grafana/variables.tf index 7dfb15831..8cc056cbd 100644 --- a/modules/grafana/variables.tf +++ b/modules/grafana/variables.tf @@ -32,3 +32,13 @@ variable "provider_settings" { description = "Map of provider-specific settings, see the backend-specific README file" default = {} } + +variable "product_version" { + description = "A valid SUSE Manager version (eg. 4.2-nightly, head) see README_ADVANCED.md" + default = "released" +} + +variable "image" { + description = "An image name, e.g. sles12sp4 or opensuse154o" + type = string +} diff --git a/modules/monitoring_server/main.tf b/modules/monitoring_server/main.tf deleted file mode 100644 index 0302269f7..000000000 --- a/modules/monitoring_server/main.tf +++ /dev/null @@ -1,37 +0,0 @@ -module "monitoring_server" { - source = "../host" - - base_configuration = var.base_configuration - name = var.name - quantity = var.quantity - use_os_released_updates = var.use_os_released_updates - use_os_unreleased_updates = var.use_os_unreleased_updates - install_salt_bundle = var.install_salt_bundle - additional_repos = var.additional_repos - additional_repos_only = var.additional_repos_only - additional_packages = var.additional_packages - gpg_keys = var.gpg_keys - swap_file_size = var.swap_file_size - ssh_key_path = var.ssh_key_path - ipv6 = var.ipv6 - connect_to_base_network = true - connect_to_additional_network = true - roles = ["monitoring_server"] - disable_firewall = var.disable_firewall - grains = { - product_version = var.product_version - 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 -} - -output "configuration" { - value = module.monitoring_server.configuration -} diff --git a/modules/monitoring_server/variables.tf b/modules/monitoring_server/variables.tf deleted file mode 100644 index 83a3fac02..000000000 --- a/modules/monitoring_server/variables.tf +++ /dev/null @@ -1,120 +0,0 @@ -variable "base_configuration" { - description = "use module.base.configuration, see the main.tf example file" -} - -variable "name" { - description = "hostname, without the domain part" - type = string -} - -variable "product_version" { - description = "A valid SUSE Manager version (eg. 4.2-nightly, head) see README_ADVANCED.md" - default = "released" -} - -variable "server_configuration" { - description = "use module..configuration, see the main.tf example file" -} - -variable "auto_connect_to_master" { - description = "whether this minion should automatically connect to the Salt Master upon deployment" - default = true -} - -variable "use_os_released_updates" { - description = "Apply all updates from SUSE Linux Enterprise repos" - default = false -} - -variable "use_os_unreleased_updates" { - description = "Apply all updates from SUSE Linux Enterprise unreleased (Test) repos" - default = false -} - -variable "avahi_reflector" { - description = "if using avahi, let the daemon be a reflector" - default = false -} - -variable "disable_firewall" { - description = "whether to disable the built-in firewall, opening up all ports" - default = true -} - -variable "additional_repos" { - description = "extra repositories in the form {label = url}, see README_ADVANCED.md" - default = {} -} - -variable "additional_repos_only" { - description = "whether to exclusively use additional repos" - default = false -} - -variable "additional_packages" { - description = "extra packages to install, see README_ADVANCED.md" - default = [] -} - -variable "install_salt_bundle" { - description = "use true to install the venv-salt-minion package in the hosts" - default = false -} - -variable "quantity" { - description = "number of hosts like this one" - default = 1 -} - -variable "grains" { - description = "custom grain map to be added to this host's configuration" - default = {} -} - -variable "swap_file_size" { - description = "Swap file size in MiB, or 0 for none" - default = 0 -} - -variable "ssh_key_path" { - description = "path of additional pub ssh key you want to use to access VMs, see README_ADVANCED.md" - default = null -} - -variable "gpg_keys" { - description = "salt/ relative paths of gpg keys that you want to add to your VMs, see README_ADVANCED.md" - default = [] -} - -variable "ipv6" { - description = "IPv6 tuning: enable it, accept the RAs" - default = { - enable = true - accept_ra = true - } -} - -variable "connect_to_base_network" { - description = "true if you want a card connected to the main network, see README_ADVANCED.md" - default = true -} - -variable "connect_to_additional_network" { - description = "true if you want a card connected to the additional network (if any), see README_ADVANCED.md" - default = false -} - -variable "image" { - description = "An image name, e.g. sles12sp4 or opensuse154o" - type = string -} - -variable "provider_settings" { - description = "Map of provider-specific settings, see the modules/libvirt/README.md" - default = {} -} - -variable "sles_registration_code" { - description = "SUMA SCC registration code to enable the SLES server" - default = null -} diff --git a/modules/monitoring_server/versions.tf b/modules/monitoring_server/versions.tf deleted file mode 100644 index 0df56de63..000000000 --- a/modules/monitoring_server/versions.tf +++ /dev/null @@ -1,13 +0,0 @@ -terraform { - required_version = "1.0.10" - required_providers { - null = { - source = "hashicorp/null" - version = ">= 2.1.0" - } - libvirt = { - source = "dmacvicar/libvirt" - version = "0.6.3" - } - } -} diff --git a/salt/monitoring_server/certs/ca.cert.pem b/salt/monitoring_server/certs/ca.cert.pem deleted file mode 100644 index 526d87dc5..000000000 --- a/salt/monitoring_server/certs/ca.cert.pem +++ /dev/null @@ -1,35 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGDDCCA/SgAwIBAgIJAKfUYNnZ1+8TMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYD -VQQGEwJERTEPMA0GA1UECAwGQmF5ZXJuMRIwEAYDVQQHDAlOdXJlbWJlcmcxDTAL -BgNVBAoMBFNVU0UxFTATBgNVBAsMDF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wDWqgidSTU32/+I8m -F+UCAwEAAaNjMGEwHQYDVR0OBBYEFH0s8wjITprBH+M6KonXjTrz8H3jMB8GA1Ud -IwQYMBaAFH0s8wjITprBH+M6KonXjTrz8H3jMA8GA1UdEwEB/wQFMAMBAf8wDgYD -VR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQA7vcA4BOhRBwTlIATnUkko -7j9IQl4sp1+MHXYJEtzfpLUiW9lP4oLT5unLIhTmPHyMW65TZVIrjt0KuABz7/u6 -EgCVHceN33BFAsVqf9SUuxxTuM8FTbbp3eM7GO37T5n2KzFgXjI0degZwERn2zX8 -/hFNhyAEWTXSGeyoWSTDR4sAQVxEPkjw8a7v2TVWYKvVLxjEPfjtLb+fLFCuiEPE -Gxw8Oza9x4MNrAG5Un28KPzc2cHxabW11Mv2H/OZwyw2MKLktb/LXFNx/B7WU1qT -Yg8Y8+jq/WdSSkll+lTGxk2lRMkt5rIGmCQlrj5yQfkRKWAFhU02QEczll2UdJW8 -0VJKA/vCsXz297ZA3utBEK98jquFPry8KGa+BLrOuj8pQTuEuhT5cm7iJxKTxSoH -dcTms/UIKjLle7ND7u3Scn/sfUz/suS8lzuvfjKKYu/ojxpFDtPER7N0YUX56PZW -/XVwk1ljiKvwPn71nhbwr5xnIVzYA9glmMSimMQqH3M+cgQM/KfCfBLEesjqM8Xg -GZSFizAvtHP77Lmz70wzRMPLz+blf7RtoOm9YiVDWFoLQ0SyQQ9c/83dzuEdqj+7 -7v7Horw5JMn1RvGqNOCIR//zk3AkQgTi/AbuYE9LflN+7iuqO6k3beycRcwqca6w -IOipUNqWJ/CanvPJl4OITg== ------END CERTIFICATE----- diff --git a/salt/monitoring_server/init.sls b/salt/monitoring_server/init.sls deleted file mode 100644 index eee3891e1..000000000 --- a/salt/monitoring_server/init.sls +++ /dev/null @@ -1,14 +0,0 @@ -include: - - scc.monitoring_server - -certificate_authority_certificate: - file.managed: - - name: /etc/pki/trust/anchors/ca.cert.pem - - source: salt://monitoring_server/certs/ca.cert.pem - - makedirs: True - -{# Do not run update-ca-certificates on SLE 15 because there is #} -{# already a systemd unit that watches for changes and runs it: #} -{# /usr/lib/systemd/system/ca-certificates.path #} - -{% endif %}