Skip to content

Commit

Permalink
QE: Copy build host files to new monitoring host module
Browse files Browse the repository at this point in the history
  • Loading branch information
vandabarata committed Nov 28, 2022
1 parent eac2794 commit 5554ec8
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 0 deletions.
37 changes: 37 additions & 0 deletions modules/monitoring_server/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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
}
120 changes: 120 additions & 0 deletions modules/monitoring_server/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
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.<SERVER_NAME>.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
}
13 changes: 13 additions & 0 deletions modules/monitoring_server/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_version = "1.0.10"
required_providers {
null = {
source = "hashicorp/null"
version = ">= 2.1.0"
}
libvirt = {
source = "dmacvicar/libvirt"
version = "0.6.3"
}
}
}

0 comments on commit 5554ec8

Please sign in to comment.