Skip to content

Commit

Permalink
Add sap support and paygo support to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
maximenoel8 committed Nov 23, 2023
1 parent 4f6b6be commit 5e58de8
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
42 changes: 42 additions & 0 deletions backend_modules/aws/base/ami.tf
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,27 @@ data "aws_ami" "sles12sp5" {
}
}

data "aws_ami" "sles12sp5-paygo" {
most_recent = true
name_regex = "^suse-sles-12-sp5-v"
owners = ["013907871322"] // aws marketplace

filter {
name = "architecture"
values = ["x86_64"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "root-device-type"
values = ["ebs"]
}
}

data "aws_ami" "rocky8" {
most_recent = true
name_regex = "^Rocky-8-ec2-8"
Expand Down Expand Up @@ -375,3 +396,24 @@ data "aws_ami" "rhel9" {
values = ["ebs"]
}
}

data "aws_ami" "sap15sp5-paygo" {
most_recent = true
name_regex = "^suse-sles-sap-15-sp5-v"
owners = ["679593333241"]

filter {
name = "architecture"
values = ["x86_64"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "root-device-type"
values = ["ebs"]
}
}
2 changes: 2 additions & 0 deletions backend_modules/aws/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ locals {
sles15sp4o = { ami = data.aws_ami.sles15sp4o.image_id },
sles15sp5o = { ami = data.aws_ami.sles15sp4o.image_id },
sles15sp5-paygo = { ami = data.aws_ami.sles15sp5-paygo.image_id },
sap15sp5-paygo = { ami = data.aws_ami.sap15sp5-paygo.image_id },
suma-server-43-byos = { ami = data.aws_ami.suma-server-43-byos.image_id },
suma-server-43-paygo = { ami = data.aws_ami.suma-server-43-paygo.image_id },
suma-proxy-43-byos = { ami = data.aws_ami.suma-proxy-43-byos.image_id },
sles12sp5 = { ami = data.aws_ami.sles12sp5.image_id },
sles12sp5-paygo = { ami = data.aws_ami.sles12sp5-paygo.image_id },
rocky8 = { ami = data.aws_ami.rocky8.image_id, ssh_user = "rocky" },
debian11 = { ami = data.aws_ami.debian11.image_id, ssh_user= "admin" },
ubuntu2204 = { ami = data.aws_ami.ubuntu2204.image_id, ssh_user = "ubuntu" },
Expand Down
4 changes: 4 additions & 0 deletions modules/controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ module "controller" {
server_http_proxy = var.server_http_proxy
custom_download_endpoint = var.custom_download_endpoint
pxeboot_image = var.pxeboot_configuration["image"]
is_using_paygo_server = var.is_using_paygo_server
is_using_build_image = var.is_using_build_image
is_using_scc_repositories = var.is_using_scc_repositories
container_runtime = lookup(var.server_configuration, "runtime", null)

sle12paygo_minion = length(var.sle12paygo_minion_configuration["hostnames"]) > 0 ? var.sle12paygo_minion_configuration["hostnames"][0] : null
sle15paygo_minion = length(var.sle15paygo_minion_configuration["hostnames"]) > 0 ? var.sle15paygo_minion_configuration["hostnames"][0] : null
sappaygo_minion = length(var.sappaygo_minion_configuration["hostnames"]) > 0 ? var.sappaygo_minion_configuration["hostnames"][0] : null
sle11sp4_minion = length(var.sle11sp4_minion_configuration["hostnames"]) > 0 ? var.sle11sp4_minion_configuration["hostnames"][0] : null
sle11sp4_sshminion = length(var.sle11sp4_sshminion_configuration["hostnames"]) > 0 ? var.sle11sp4_sshminion_configuration["hostnames"][0] : null
sle11sp4_client = length(var.sle11sp4_client_configuration["hostnames"]) > 0 ? var.sle11sp4_client_configuration["hostnames"][0] : null
Expand Down
29 changes: 28 additions & 1 deletion modules/controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ variable "monitoringserver_configuration" {
}
}

variable "sle12paygo_minion_configuration" {
description = "use module.<SLE12PAYGO_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}

variable "sle15paygo_minion_configuration" {
description = "use module.<SLE15PAYGO_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}

variable "sappaygo_minion_configuration" {
description = "use module.<SAPPAYGO_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
hostnames = []
}
}


variable "sle11sp4_minion_configuration" {
description = "use module.<SLE11SP4_MINION>.configuration, see main.tf.libvirt-testsuite.example"
default = {
Expand Down Expand Up @@ -712,6 +734,11 @@ variable "no_mirror" {
default = false
}

variable "is_using_paygo_server" {
description = "Specify to controller that server image is a paygo image"
default = false
}

variable "is_using_build_image" {
description = "Specify to controller that server image is a build image"
default = false
Expand All @@ -726,7 +753,7 @@ variable "nested_vm_host" {
description = "Hostname for a nested VM if it is used, see README_TESTING.md"
type = string
default = "min-nested"
}
}is_using_build_image

variable "nested_vm_mac" {
description = "MAC address for a nested VM if it is used, see README_TESTING.md"
Expand Down
4 changes: 4 additions & 0 deletions salt/controller/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export VIRTHOST_KVM_PASSWORD="linux" {% else %}# no KVM host defined {% endif %}
{% if grains.get('mirror') | default(false, true) %}export MIRROR="yes" {% else %}# no mirror used {% endif %}

# QAM clients
{% if grains.get('sle12paygo_minion') | default(false, true) %}export SLE12PAYGO_MINION="{{ grains.get('sle12paygo_minion') }}" {% else %}# no SLE12PAYGO minion defined {% endif %}
{% if grains.get('sle15paygo_minion') | default(false, true) %}export SLE15PAYGO_MINION="{{ grains.get('sle15paygo_minion') }}" {% else %}# no SLE15PAYGO minion defined {% endif %}
{% if grains.get('sap15paygo_minion') | default(false, true) %}export SAP15PAYGO_MINION="{{ grains.get('sap15paygo_minion') }}" {% else %}# no SAP15PAYGO minion defined {% endif %}
{% if grains.get('sle11sp4_minion') | default(false, true) %}export SLE11SP4_MINION="{{ grains.get('sle11sp4_minion') }}" {% else %}# no SLE11SP4 minion defined {% endif %}
{% if grains.get('sle11sp4_sshminion') | default(false, true) %}export SLE11SP4_SSHMINION="{{ grains.get('sle11sp4_sshminion') }}" {% else %}# no SLE11SP4 ssh minion defined {% endif %}
{% if grains.get('sle11sp4_client') | default(false, true) %}export SLE11SP4_CLIENT="{{ grains.get('sle11sp4_client') }}" {% else %}# no SLE11SP4 client defined {% endif %}
Expand Down Expand Up @@ -111,6 +114,7 @@ export AUTH_REGISTRY_CREDENTIALS="{{ grains.get('auth_registry_username') }}|{{
export PROVIDER="{{ grains.get('provider') }}"
{% if grains.get('container_runtime') | default(false, true) %}export CONTAINER_RUNTIME="{{ grains.get('container_runtime') }}" {% else %}# no CONTAINER_RUNTIME used {% endif %}
{% if 'build_image' not in grains.get('product_version') | default('', true) %}export IS_USING_BUILD_IMAGE="{{ grains.get('is_using_build_image') }}" {% endif %}
export IS_USING_PAYGO_SERVER="{{ grains.get('is_using_paygo_server') }}"
export IS_USING_SCC_REPOSITORIES="{{ grains.get('is_using_scc_repositories') }}"

#### Generate certificates for Google Chrome
Expand Down

0 comments on commit 5e58de8

Please sign in to comment.