Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions backend_modules/aws/base/ami.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data "aws_region" "current" {}

data "aws_ami" "tumbleweedo" {
# Only execute this lookup if the region is eu-central-1 (Frankfurt)
count = data.aws_region.current.id == "eu-central-1" ? 1 : 0
count = data.aws_region.current.region == "eu-central-1" ? 1 : 0

most_recent = true
owners = ["self"] // custom built AMI
Expand All @@ -18,28 +18,6 @@ data "aws_ami" "tumbleweedo" {
}
}


data "aws_ami" "opensuse156o" {
most_recent = true
name_regex = "^openSUSE-Leap-15.6-"
owners = ["679593333241"]

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

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

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

data "aws_ami" "opensuse160o" {
most_recent = true
name_regex = "^openSUSE-Leap-16-0-"
Expand Down
1 change: 0 additions & 1 deletion backend_modules/aws/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ locals {
iam_instance_profile = length(aws_iam_instance_profile.metering_full_access_instance_profile) > 0 ? aws_iam_instance_profile.metering_full_access_instance_profile[0].name : null
ami_info = {
tumbleweedo = { ami = one(data.aws_ami.tumbleweedo[*].image_id) }, // custom Tumbleweed AMI }
opensuse156o = { ami = data.aws_ami.opensuse156o.image_id },
opensuse160o = { ami = data.aws_ami.opensuse160o.image_id },
sles15sp4o = { ami = data.aws_ami.sles15sp4o.image_id },
sles15sp5o = { ami = data.aws_ami.sles15sp5o.image_id },
Expand Down
2 changes: 2 additions & 0 deletions backend_modules/aws/host/user_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ runcmd:

%{ if image == "opensuse160o" ~}
runcmd:
- zypper addrepo -G -e http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable:/openSUSE_Leap_16-Uyuni-Client-Tools/openSUSE_Leap_16.0/ client_tools_tmp
- zypper ref
%{ if install_salt_bundle ~}
- zypper in --allow-vendor-change --no-confirm venv-salt-minion
%{ else ~}
Expand Down
2 changes: 1 addition & 1 deletion modules/controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module "controller" {
salt_migration_minion = length(var.salt_migration_minion_configuration["hostnames"]) > 0 ? var.salt_migration_minion_configuration["hostnames"][0] : null
}

image = "opensuse156o"
image = var.image
provider_settings = var.provider_settings
}

Expand Down
5 changes: 5 additions & 0 deletions modules/controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ variable "ipv6" {
}
}

variable "image" {
description = "An image name, e.g. sles12sp4 or opensuse156o"
type = string
}

variable "git_profiles_repo" {
description = "URL of git repository with alternate Docker and Kiwi profiles, see README_ADVANCED.md"
default = "default"
Expand Down
6 changes: 4 additions & 2 deletions modules/cucumber_testsuite/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,11 @@ module "monitoring_server" {

module "controller" {
source = "../controller"
name = lookup(local.names, "controller", "controller")

base_configuration = module.base.configuration
base_configuration = module.base.configuration
image = lookup(local.images, "controller", "opensuse156o")
name = lookup(local.names, "controller", "controller")

server_configuration = local.server_configuration
proxy_configuration = local.proxy_configuration
client_configuration = contains(local.hosts, "suse_client") ? module.suse_client.configuration : { hostnames = [], ids = [], ipaddrs = [], macaddrs = [], private_macs = [] }
Expand Down
22 changes: 18 additions & 4 deletions salt/controller/apache_https.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@ apache2_service_stopped:
- name: apache2
- enable: False

# Install Apache SSL package (needed for certificate generation tools)
apache2_ssl_package:
# Install standard Apache and OpenSSL tools (needed for certificate generation tools)
apache2_base_packages:
pkg.installed:
- name: apache2-mod_nss
- pkgs:
- apache2
- openssl

apache2_ssl_directories:
file.directory:
- names:
- /etc/apache2/ssl.key
- /etc/apache2/ssl.crt
- user: root
- group: root
- mode: 755
- makedirs: True
- require:
- pkg: apache2_base_packages

# Generate Self-Signed Certificate (used by Python script)
self_signed_cert:
Expand All @@ -22,7 +36,7 @@ self_signed_cert:
-subj '/CN={{ server_name }}/O=Controller/OU=Testsuite'
- unless: test -f /etc/apache2/ssl.crt/selfsigned.crt
- require:
- pkg: apache2_ssl_package
- file: apache2_ssl_directories

# Manage the Python Script file
https_python_script_file:
Expand Down
31 changes: 18 additions & 13 deletions salt/controller/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ include:
- repos
- controller.apache_https

{% set ruby_version = '3.4' if grains['osrelease'] == '16.0' else '3.3' %}
# WORKAROUND: remove once healthcheck is available for Leap 16 too.
# Right now Tumbleweed has a version for which we can satisfy the dependencies
{% set healthcheck_os = 'openSUSE_Tumbleweed' if grains['osrelease'] == '16.0' else grains['osrelease'] %}

ssh_private_key:
file.managed:
- name: /root/.ssh/id_ed25519
Expand Down Expand Up @@ -32,11 +37,10 @@ cucumber_requisites:
- gcc
- make
- wget
- ruby3.3
- ruby3.3-devel
- ruby{{ ruby_version }}
- ruby{{ ruby_version }}-devel
- ca-certificates-mozilla
- apache2-worker
- apache2-mod_nss
- cantarell-fonts
- git-core
- aaa_base-extras
Expand All @@ -47,34 +51,34 @@ cucumber_requisites:

/usr/bin/ruby:
file.symlink:
- target: /usr/bin/ruby.ruby3.3
- target: /usr/bin/ruby.ruby{{ ruby_version }}
- force: True

/usr/bin/gem:
file.symlink:
- target: /usr/bin/gem.ruby3.3
- target: /usr/bin/gem.ruby{{ ruby_version }}
- force: True

/usr/bin/irb:
file.symlink:
- target: /usr/bin/irb.ruby3.3
- target: /usr/bin/irb.ruby{{ ruby_version }}
- force: True

ruby_set_rake_version:
cmd.run:
- name: update-alternatives --set rake /usr/bin/rake.ruby.ruby3.3
- name: update-alternatives --set rake /usr/bin/rake.ruby.ruby{{ ruby_version }}

ruby_set_bundle_version:
cmd.run:
- name: update-alternatives --set bundle /usr/bin/bundle.ruby.ruby3.3
- name: update-alternatives --set bundle /usr/bin/bundle.ruby.ruby{{ ruby_version }}

ruby_set_rdoc_version:
cmd.run:
- name: update-alternatives --set rdoc /usr/bin/rdoc.ruby.ruby3.3
- name: update-alternatives --set rdoc /usr/bin/rdoc.ruby.ruby{{ ruby_version }}

ruby_set_ri_version:
cmd.run:
- name: update-alternatives --set ri /usr/bin/ri.ruby.ruby3.3
- name: update-alternatives --set ri /usr/bin/ri.ruby.ruby{{ ruby_version }}

# Distro Chromium is kept ONLY to provide the shared libraries (libgbm, NSS, fonts, ...)
# that the Playwright-managed Chromium needs. It is not the browser Playwright launches.
Expand Down Expand Up @@ -120,12 +124,13 @@ playwright_cli_env:

install_gems_via_bundle:
cmd.run:
- name: bundle.ruby.ruby3.3 install --gemfile Gemfile
- name: bundle.ruby.ruby{{ ruby_version }} install --gemfile Gemfile
- cwd: /root/spacewalk/testsuite
- require:
- pkg: cucumber_requisites
- cmd: spacewalk_git_repository


# https://github.com/WasiqB/multiple-cucumber-html-reporter
# Replaces cucumber-html-reporter
# Preserves JSON execution order, supports filter by passed/failed/skipped
Expand Down Expand Up @@ -227,8 +232,8 @@ google_cert_db:
# Health-check testing
health_check_repo:
pkgrepo.managed:
- baseurl: http://{{ grains.get("mirror") | default("download.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/healthcheck:/Stable/{{ grains.get("osrelease") }}
- gpgkey: http://{{ grains.get("mirror") | default("download.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/healthcheck:/Stable/{{ grains.get("osrelease") }}/repodata/repomd.xml.key
- baseurl: http://{{ grains.get("mirror") | default("download.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/healthcheck:/Stable/{{ healthcheck_os }}
- gpgkey: http://{{ grains.get("mirror") | default("download.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/healthcheck:/Stable/{{ healthcheck_os }}/repodata/repomd.xml.key
- gpgcheck: 0
- refresh: True

Expand Down
6 changes: 3 additions & 3 deletions salt/default/hostname.sls
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ change_searchlist_netconfig:
- name: /etc/sysconfig/network/config
- pattern: NETCONFIG_DNS_STATIC_SEARCHLIST=.*
- repl: NETCONFIG_DNS_STATIC_SEARCHLIST="{{ grains['domain'] }}"
- onlyif: test -f /etc/sysconfig/network/config
- onlyif: test -f /etc/sysconfig/network/config && command -v netconfig

netconfig_update:
cmd.run:
- name: netconfig update -f
- require:
- file: change_searchlist_netconfig
- onlyif: test -f /etc/sysconfig/network/config
- onlyif: test -f /etc/sysconfig/network/config && command -v netconfig

change_searchlist:
file.append:
- name: /etc/resolv.conf
- text: search {{ grains['domain'] }}
- unless: test -f /etc/sysconfig/network/config
- unless: test -f /etc/sysconfig/network/config && command -v netconfig

# set the hostname and FQDN name in /etc/hosts
# this is not needed if a proper DNS server is in place, but when using avahi this
Expand Down
8 changes: 6 additions & 2 deletions salt/repos/ruby.sls
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{% if grains['os'] == 'SUSE' and ('controller' in grains.get('roles')) %}
{% set repo_version = grains['osrelease'] %}

ruby_add_devel_repository:
pkgrepo.managed:
- name: ruby_devel
- baseurl: http://download.opensuse.org/repositories/devel:/languages:/ruby/15.6/
- baseurl: "http://download.opensuse.org/repositories/devel:/languages:/ruby/{{ repo_version }}/"
- refresh: True
- gpgautoimport: True


{% if repo_version != '16.0' %}
ruby_gems_add_devel_repository:
pkgrepo.managed:
- name: ruby_devel_extensions
- baseurl: http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/15.6/
- baseurl: "http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/{{ repo_version }}/"
- refresh: True
- gpgautoimport: True
{% endif %}

{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion salt/repos/tools.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
) %}

{% if grains['osfullname'] == 'Leap' %}
{% set path = 'openSUSE_Leap_' + grains['osrelease'] %}
{% set path = grains['osrelease'] if grains['osrelease'] == '16.0' else 'openSUSE_Leap_' + grains['osrelease'] %}
{% endif %}

{% if grains['osfullname'] != 'Leap' %}
Expand Down
Loading