Skip to content

Commit

Permalink
NR-140770 ci: use custom sles AMIs (#1704)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenruizdegauna authored Jul 19, 2023
1 parent 9ddf7b1 commit 1cfd539
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 42 deletions.
99 changes: 57 additions & 42 deletions test/automated/ansible/group_vars/localhost/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,80 +128,95 @@ instances:
############################
# sles amd64
############################
# Disabled until EOLed repo sources are fixed
# - ami: "ami-0b39df28334229e26"
# type: "t3a.small"
# name: "amd64:sles-12.2"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
# - ami: "ami-0479b39f2d07530fb"
# type: "t3a.small"
# name: "amd64:sles-12.3"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
# - ami: "ami-0c79914d840ad4560"
# type: "t3a.small"
# name: "amd64:sles-12.4"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-05f6084a6b524a8f0"
- ami: "ami-05fcf0a794c3b5994" # based on suse-sles-12-sp3-byos-v20220201-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-12.3"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0ff9876855bed84bd" # based on suse-sles-12-sp4-byos-v20220519-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-12.4"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0199192e7fdbb9b62" # based on suse-sles-12-sp5-v20230206-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-12.5"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
# - ami: "ami-0b14d12cfa5e9dcc5"
# type: "t3a.small"
# name: "amd64:sles-15.2"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python3"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-055742ec92937ec3e"
- ami: "ami-08441b51466d3bb43" # based on suse-sles-15-sp1-byos-v20220128-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-15.1"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0e44499c443e91acd" # based on suse-sles-15-sp2-byos-v20220128-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-15.2"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0446c700e1dc61753" # based on suse-sles-15-sp3-v20210622-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-15.3"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0ca19ecee2be612fc"
- ami: "ami-0bde5989b70490b94" # based on suse-sles-15-sp4-v20220915-hvm-ssd-x86_64
type: "t3a.small"
name: "amd64:sles-15.4"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
# Infra Agent not supported yet
# - ami: "ami-0e03a27c1453107db" # based on suse-sles-15-sp5-v20230620-hvm-ssd-x86_64
# type: "t3a.small"
# name: "amd64:sles-15.5"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python3"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
############################
# sles arm64
############################
# - ami: "ami-0ccf2efb4e042d474"
# type: "t4g.small"
# name: "arm64:sles-15.2"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python3"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-075a486be6269029f"
- ami: "ami-087e5fdeac18a84ae" # based on suse-sles-15-sp1-byos-v20220128-hvm-ssd-arm64
type: "t4g.small"
name: "arm64:sles-15.3"
name: "arm64:sles-15.1"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0885abe5302e6fee0"
- ami: "ami-0194f07e3eedf8118"
type: "t4g.small"
name: "arm64:sles-15.3" # based on suse-sles-15-sp3-v20211219-hvm-ssd-arm64
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
- ami: "ami-0c55a43a5be3c61bc" # based on suse-sles-15-sp4-v20220915-hvm-ssd-arm64
type: "t4g.small"
name: "arm64:sles-15.4"
username: "ec2-user"
platform: "linux"
python_interpreter: "/usr/bin/python3"
launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
# Infra Agent not supported yet
# - ami: "ami-046216af2ce255621" # based on suse-sles-15-sp5-v20230620-hvm-ssd-arm64
# type: "t4g.small"
# name: "arm64:sles-15.5"
# username: "ec2-user"
# platform: "linux"
# python_interpreter: "/usr/bin/python3"
# launch_template: "LaunchTemplateId=lt-0b00afb3f5110a0e6,Version=3"
############################
# redhat amd64
############################
Expand Down
4 changes: 4 additions & 0 deletions test/automated/ansible/install-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
include_role:
name: remove-eol-sources

- name: Configure OpenSUSE repositories when needed
include_role:
name: opensuse-repositories

- name: re-install rpm
include_role:
name: reinstall-rpm
Expand Down
3 changes: 3 additions & 0 deletions test/automated/ansible/roles/install-libcap/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
instances_requiring_libcap_progs:
- "amd64:sles-12.3"
- "amd64:sles-12.4"
- "amd64:sles-12.5"
- "amd64:sles-15.1"
Expand All @@ -8,6 +9,8 @@ instances_requiring_libcap_progs:
- "arm64:sles-15.3"
- "amd64:sles-15.4"
- "arm64:sles-15.4"
- "amd64:sles-15.5"
- "arm64:sles-15.5"
instances_requiring_libcap2:
- "amd64:debian-stretch"
- "arm64:debian-stretch"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: get Suse version from hostname
set_fact:
suse_version: "{{ inventory_hostname | regex_replace('[^:]+:[^:]+:sles-', '') }}"

- name: configure OpenSUSE repositories for distributions BYOS (Bring Your Own Subscription)
template:
src: OpenSUSE-repositories.repo.j2
dest: /etc/zypp/repos.d/OpenSUSE-repositories.repo

- name: 'refresh zypper cache'
command: zypper --gpg-auto-import-keys refresh OpenSUSE-{{ suse_version }}-OSS
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- include_tasks: configure_opensuse_repository.yml
when: inventory_hostname is search(item.key)
loop: "{{ instances_requiring_opensuse_repos | dict2items }}"
vars:
suse_repo_base_url: "{{ item.value }}"

...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[OpenSUSE-{{ suse_version }}-OSS]
name=OpenSUSE-{{ suse_version }}-OSS
enabled=1
baseurl={{ suse_repo_base_url }}
type=yast
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instances_requiring_opensuse_repos:
"sles-12.3": http://download.opensuse.org/distribution/12.3/repo/oss/
"sles-12.4": http://download.opensuse.org/distribution/12.3/repo/oss/
"sles-15.1": http://download.opensuse.org/distribution/leap/15.1/repo/oss/
"sles-15.2": http://download.opensuse.org/distribution/leap/15.2/repo/oss/

5 changes: 5 additions & 0 deletions test/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ TESTS_TO_RUN_REGEXP ?= ".*"
test/automated/harvest:
AGENT_RUN_DIR=$(CURDIR) ANSIBLE_FORKS=$(ANSIBLE_FORKS) ANSIBLE_INVENTORY=$(ANSIBLE_INVENTORY) $(CURDIR)/test/harvest/ansible/harvest.sh

.PHONY: test/automated/install-requirements
test/automated/install-requirements:
@ANSIBLE_DISPLAY_SKIPPED_HOSTS=NO ANSIBLE_DISPLAY_OK_HOSTS=NO ansible-playbook -f $(ANSIBLE_FORKS) -i $(ANSIBLE_INVENTORY) --limit=$(LIMIT) $(CURDIR)/test/automated/ansible/install-requirements.yml


.PHONY: test/automated/packaging
test/automated/packaging:
ifndef NR_LICENSE_KEY
Expand Down

0 comments on commit 1cfd539

Please sign in to comment.