From e49e003862cd7afe0d2d38d9e7bfe12018835e8c Mon Sep 17 00:00:00 2001 From: maximenoel8 <55169628+maximenoel8@users.noreply.github.com> Date: Tue, 20 Dec 2022 10:57:43 +1300 Subject: [PATCH] Rhel9 support on aws (#1225) * Add rhel9 support to sumaform AWS --- backend_modules/aws/host/user_data.yaml | 13 +++++++++++++ modules/controller/main.tf | 2 ++ modules/controller/variables.tf | 14 ++++++++++++++ salt/controller/bashrc | 2 ++ 4 files changed, 31 insertions(+) diff --git a/backend_modules/aws/host/user_data.yaml b/backend_modules/aws/host/user_data.yaml index 7838494fb..0f5147ab9 100644 --- a/backend_modules/aws/host/user_data.yaml +++ b/backend_modules/aws/host/user_data.yaml @@ -108,6 +108,7 @@ runcmd: - zypper removerepo --all - rm /etc/modprobe.d/50-ipv6.conf %{ endif } + %{ if image == "rhel9"} yum_repos: # repo for salt @@ -118,8 +119,20 @@ yum_repos: gpgcheck: false name: temp_tools_pool_repo priority: 98 + epel: + baseurl: http://download-cc-rdu01.fedoraproject.org/pub/epel/9/Everything/x86_64/ + failovermethod: priority + enabled: true + gpgcheck: false + name: epel + priority: 98 packages: ["salt-minion"] +runcmd: + # WORKAROUND: rhel9 change ssh security for ssh key + - echo "PermitRootLogin yes" >> /etc/ssh/sshd_config + - systemctl restart sshd + %{ endif } %{ if image == "rhel8"} yum_repos: diff --git a/modules/controller/main.tf b/modules/controller/main.tf index 256edb107..98f967e65 100644 --- a/modules/controller/main.tf +++ b/modules/controller/main.tf @@ -96,6 +96,8 @@ module "controller" { rocky8_sshminion = length(var.rocky8_sshminion_configuration["hostnames"]) > 0 ? var.rocky8_sshminion_configuration["hostnames"][0] : null rocky9_minion = length(var.rocky9_minion_configuration["hostnames"]) > 0 ? var.rocky9_minion_configuration["hostnames"][0] : null rocky9_sshminion = length(var.rocky9_sshminion_configuration["hostnames"]) > 0 ? var.rocky9_sshminion_configuration["hostnames"][0] : null + rhel9_minion = length(var.rhel9_minion_configuration["hostnames"]) > 0 ? var.rhel9_minion_configuration["hostnames"][0] : null + rhel9_sshminion = length(var.rhel9_sshminion_configuration["hostnames"]) > 0 ? var.rhel9_sshminion_configuration["hostnames"][0] : null ubuntu1604_minion = length(var.ubuntu1604_minion_configuration["hostnames"]) > 0 ? var.ubuntu1604_minion_configuration["hostnames"][0] : null ubuntu1604_sshminion = length(var.ubuntu1604_sshminion_configuration["hostnames"]) > 0 ? var.ubuntu1604_sshminion_configuration["hostnames"][0] : null ubuntu1804_minion = length(var.ubuntu1804_minion_configuration["hostnames"]) > 0 ? var.ubuntu1804_minion_configuration["hostnames"][0] : null diff --git a/modules/controller/variables.tf b/modules/controller/variables.tf index 4cadc30f1..148271440 100644 --- a/modules/controller/variables.tf +++ b/modules/controller/variables.tf @@ -356,6 +356,20 @@ variable "rocky9_sshminion_configuration" { } } +variable "rhel9_minion_configuration" { + description = "use module..configuration, see main.tf.libvirt-testsuite.example" + default = { + hostnames = [] + } +} + +variable "rhel9_sshminion_configuration" { + description = "use module..configuration, see main.tf.libvirt-testsuite.example" + default = { + hostnames = [] + } +} + variable "ubuntu1604_minion_configuration" { description = "use module..configuration, see main.tf.libvirt-testsuite.example" default = { diff --git a/salt/controller/bashrc b/salt/controller/bashrc index dbffd6157..2ddc74842 100644 --- a/salt/controller/bashrc +++ b/salt/controller/bashrc @@ -55,6 +55,8 @@ export VIRTHOST_KVM_PASSWORD="linux" {% else %}# no KVM host defined {% endif %} {% if grains.get('rocky8_sshminion') | default(false, true) %}export ROCKY8_SSHMINION="{{ grains.get('rocky8_sshminion') }}" {% else %}# no ROCKY8 ssh minion defined {% endif %} {% if grains.get('rocky9_minion') | default(false, true) %}export ROCKY9_MINION="{{ grains.get('rocky9_minion') }}" {% else %}# no ROCKY9 minion defined {% endif %} {% if grains.get('rocky9_sshminion') | default(false, true) %}export ROCKY9_SSHMINION="{{ grains.get('rocky9_sshminion') }}" {% else %}# no ROCKY9 ssh minion defined {% endif %} +{% if grains.get('rhel9_minion') | default(false, true) %}export RHEL9_MINION="{{ grains.get('rhel9_minion') }}" {% else %}# no RHEL9 minion defined {% endif %} +{% if grains.get('rhel9_sshminion') | default(false, true) %}export RHEL9_SSHMINION="{{ grains.get('rhel9_sshminion') }}" {% else %}# no RHEL9 ssh minion defined {% endif %} {% if grains.get('ubuntu1604_minion') | default(false, true) %}export UBUNTU1604_MINION="{{ grains.get('ubuntu1604_minion') }}" {% else %}# no UBUNTU1604 minion defined {% endif %} {% if grains.get('ubuntu1604_sshminion') | default(false, true) %}export UBUNTU1604_SSHMINION="{{ grains.get('ubuntu1604_sshminion') }}" {% else %}# no UBUNTU1604 ssh minion defined {% endif %} {% if grains.get('ubuntu1804_minion') | default(false, true) %}export UBUNTU1804_MINION="{{ grains.get('ubuntu1804_minion') }}" {% else %}# no UBUNTU1804 minion defined {% endif %}