Skip to content

Commit

Permalink
Add support for Leap Micro and combustion
Browse files Browse the repository at this point in the history
In order to support leap micro we need combustion support in the libvirt
provider. This requires this pull request:

dmacvicar/terraform-provider-libvirt#1068

Review configuration for PR testing

Signed-off-by: Jordi Massaguer Pla <[email protected]>
  • Loading branch information
cbosdo authored and jordimassaguerpla committed Mar 27, 2024
1 parent 53af91d commit df1791a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
7 changes: 7 additions & 0 deletions backend_modules/libvirt/host/combustion
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/repos
zypper ar http://${ use_mirror_images ? mirror : "download.opensuse.org" }/update/leap/15.5/sle/ sle_update_repo
%{ endif }

for i in ${additional_repos};do
name=$(echo $i | cut -d= -f1)
url=$(echo $i | cut -d= -f2)
zypper ar $url $name
done


# Install packages
PACKAGES="qemu-guest-agent avahi ca-certificates"
%{ if container_server }
Expand Down
1 change: 1 addition & 0 deletions backend_modules/libvirt/host/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ data "template_file" "combustion" {
container_proxy = contains(var.roles, "proxy_containerized")
container_runtime = local.container_runtime
testsuite = lookup(var.base_configuration, "testsuite", false)
additional_repos = join(" ", [for key, value in var.additional_repos : "${key}=${value}"])
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/server_containerized/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variable "images" {
"head" = "slemicro55o"
"uyuni-master" = "opensuse155o"
"uyuni-released" = "opensuse155o"
"uyuni-pr" = "opensuse155o"
"uyuni-pr" = "leapmicro55o"
}
}

Expand Down
2 changes: 1 addition & 1 deletion salt/default/minimal.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include:
- default.time

minimal_package_update:
{% if grains['os_family'] == 'Suse' and grains['osfullname'] == 'SLE Micro' %}
{% if grains['os_family'] == 'Suse' and grains['osfullname'] in['SLE Micro', 'openSUSE Leap Micro'] %}
cmd.run:
{% if grains['install_salt_bundle'] %}
- name: transactional-update -c package up zypper libzypp venv-salt-minion
Expand Down
4 changes: 3 additions & 1 deletion salt/repos/additional.sls
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Skip Micro OSes, given the additional repos are set up by combustion/ignition/cloud-init
{% if grains['osfullname'] not in ['SLE Micro', 'openSUSE Leap Micro'] %}
{% if grains['additional_repos'] %}
{% for label, url in grains['additional_repos'].items() %}
{{ label }}_repo:
Expand Down Expand Up @@ -57,7 +59,7 @@ update-ca-certificates:
{% endif %}
{% endfor %}
{% endif %}

{% endif %}
# WORKAROUND: see github:saltstack/salt#10852
{{ sls }}_nop:
test.nop: []
30 changes: 30 additions & 0 deletions salt/server_containerized/testsuite.sls
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,41 @@ repo_key_import:
- cmd: galaxy_key_copy
{% endif %}

testing_overlay_devel_repo:
cmd.run:
{%- if grains.get('product_version') | default('', true) in ['uyuni-master', 'uyuni-pr', 'uyuni-released'] %}
- name: 'mgrctl exec "zypper -n ar -f -p 96 http://{{ grains.get("mirror") | default("downloadcontent.opensuse.org", true) }}/repositories/systemsmanagement:/Uyuni:/Master/images/repo/Testing-Overlay-POOL-x86_64-Media1/ testing_overlay_devel_repo"'
{%- else %}
- name: 'mgrctl exec "zypper -n ar -f -p 96 http://{{ grains.get("mirror") | default("download.suse.de", true) }}//ibs/Devel:/Galaxy:/Manager:/Head/images/repo/SLE-Module-SUSE-Manager-Testing-Overlay-4.3-POOL-x86_64-Media1/ testing_overlay_devel_repo"'
{%- endif %}
- unless: mgrctl exec "zypper lr" | grep testing_overlay_devel_repo
- require:
{% if grains['osfullname'] not in ['SLE Micro', 'openSUSE Leap Micro'] %}
- pkg: uyuni-tools
{% endif %}
- cmd: repo_key_import

# Allowing downgrade of salt-ssh as it has sometimes a slightly older version than what is in the image
{% if 'build_image' not in grains.get('product_version') | default('', true) %}
saltssh_package:
cmd.run:
- name: mgrctl exec "zypper -n in --allow-downgrade salt-ssh"
- require:
{% if grains['osfullname'] not in ['SLE Micro', 'openSUSE Leap Micro'] %}
- pkg: uyuni-tools
{% endif %}
- cmd: testing_overlay_devel_repo
{% endif %}

testsuite_packages:
cmd.run:
- name: mgrctl exec "zypper -n in iputils expect wget OpenIPMI"
{% if grains['osfullname'] not in ['SLE Micro', 'openSUSE Leap Micro'] %}
- require:
{% if 'build_image' not in grains.get('product_version') | default('', true) %}
- cmd: saltssh_package
{% endif %}
{% if grains['osfullname'] not in ['SLE Micro', 'openSUSE Leap Micro'] %}
- pkg: uyuni-tools
{% endif %}

Expand Down

0 comments on commit df1791a

Please sign in to comment.