Skip to content

Commit b89da3b

Browse files
authored
Merge pull request #552 from stackhpc/upstream/master-2026-04-20
Synchronise master with upstream
2 parents 3cb34a9 + 6d34bfd commit b89da3b

6 files changed

Lines changed: 43 additions & 11 deletions

File tree

ansible/inventory/group_vars/all/ipa

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
# Whether to build IPA images from source.
88
ipa_build_images: False
99

10+
# Override the OS distribution used to build IPA images. Default is the host
11+
# distribution.
12+
ipa_build_distro: "{{ os_distribution }}"
13+
14+
# Override the OS release used to build IPA images. Default is the host
15+
# release.
16+
ipa_build_release: "{{ os_release }}"
17+
1018
# URL of IPA source repository.
1119
ipa_build_source_url: "https://opendev.org/openstack/ironic-python-agent"
1220

@@ -24,11 +32,12 @@ ipa_build_dib_host_packages_extra: [ 'zstd' ]
2432

2533
# List of default Diskimage Builder (DIB) elements to use when building IPA
2634
# images. Default is ["rocky-container", "dynamic-login",
27-
# "enable-serial-console", "ironic-python-agent-ramdisk"] when os_distribution
28-
# is "rocky", and ["ubuntu", "dynamic-login", "enable-serial-console",
29-
# "ironic-python-agent-ramdisk"] otherwise.
35+
# "enable-serial-console", "ironic-python-agent-ramdisk", "baremetal"] when
36+
# ipa_build_distro is "rocky", and [ipa_build_distro, "dynamic-login",
37+
# "enable-serial-console", "ironic-python-agent-ramdisk", "baremetal"]
38+
# otherwise.
3039
ipa_build_dib_elements_default:
31-
- "{{ 'rocky-container' if os_distribution == 'rocky' else os_distribution }}"
40+
- "{{ 'rocky-container' if ipa_build_distro == 'rocky' else ipa_build_distro }}"
3241
- dynamic-login
3342
- enable-serial-console
3443
- ironic-python-agent-ramdisk
@@ -48,7 +57,7 @@ ipa_build_dib_elements: >
4857
# Dictionary of default environment variables to provide to Diskimage Builder
4958
# (DIB) during IPA image build.
5059
ipa_build_dib_env_default:
51-
DIB_RELEASE: "{{ os_release }}"
60+
DIB_RELEASE: "{{ ipa_build_release }}"
5261
DIB_CONTAINERFILE_RUNTIME: "{{ container_engine }}"
5362
DIB_CONTAINERFILE_RUNTIME_ROOT: "{{ (container_engine == 'podman') | int }}"
5463
DIB_REPOLOCATION_ironic_python_agent: "{{ ipa_build_source_url }}"
@@ -86,9 +95,9 @@ ipa_build_dib_git_elements: >-
8695
{{ ipa_build_dib_git_elements_default + ipa_build_dib_git_elements_extra }}
8796

8897
# List of DIB packages to install. Default is ["python3-yaml"] when
89-
# when os_distribution is "rocky", otherwise [].
98+
# when ipa_build_distro is "rocky", otherwise [].
9099
ipa_build_dib_packages: >-
91-
{{ ["python3-yaml"] if os_distribution == 'rocky' else [] }}
100+
{{ ["python3-yaml"] if ipa_build_distro == 'rocky' else [] }}
92101

93102
# Upper constraints file for installing packages in the virtual environment
94103
# used for building IPA images. Default is {{ pip_upper_constraints_file }}.

etc/kayobe/ipa.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
# Whether to build IPA images from source.
88
#ipa_build_images:
99

10+
# Override the OS distribution used to build IPA images. Default is the host
11+
# distribution.
12+
#ipa_build_distro:
13+
14+
# Override the OS release used to build IPA images. Default is the host
15+
# release.
16+
#ipa_build_release:
17+
1018
# URL of IPA source repository.
1119
#ipa_build_source_url:
1220

@@ -24,9 +32,10 @@
2432

2533
# List of default Diskimage Builder (DIB) elements to use when building IPA
2634
# images. Default is ["rocky-container", "dynamic-login",
27-
# "enable-serial-console", "ironic-python-agent-ramdisk"] when os_distribution
28-
# is "rocky", and ["ubuntu", "dynamic-login", "enable-serial-console",
29-
# "ironic-python-agent-ramdisk"] otherwise.
35+
# "enable-serial-console", "ironic-python-agent-ramdisk", "baremetal"] when
36+
# ipa_build_distro is "rocky", and [ipa_build_distro, "dynamic-login",
37+
# "enable-serial-console", "ironic-python-agent-ramdisk", "baremetal"]
38+
# otherwise.
3039
#ipa_build_dib_elements_default:
3140

3241
# List of additional Diskimage Builder (DIB) elements to use when building IPA
@@ -65,7 +74,7 @@
6574
#ipa_build_dib_git_elements:
6675

6776
# List of DIB packages to install. Default is ["python3-yaml"] when
68-
# when os_distribution is "rocky", otherwise [].
77+
# when ipa_build_distro is "rocky", otherwise [].
6978
#ipa_build_dib_packages:
7079

7180
# Upper constraints file for installing packages in the virtual environment

playbooks/kayobe-overcloud-host-configure-base/run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
command: "{{ testinfra_venv }}/bin/py.test {{ test_path }} --html={{ logs_dir }}/test-results.html --self-contained-html"
3535
environment:
3636
SITE_MIRROR_FQDN: "{{ zuul_site_mirror_fqdn }}"
37+
FAIL2BAN_ENABLED: "{{ fail2ban_enabled | default(false) }}"
3738

3839
- name: Test bouncing interfaces
3940
shell:

playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def _is_ubuntu_noble():
3333
return name == 'Ubuntu' and version == '24.04'
3434

3535

36+
def _is_fail2ban_enabled():
37+
return os.environ.get('FAIL2BAN_ENABLED', 'false').lower() == 'true'
38+
39+
3640
def test_network_ethernet(host):
3741
interface = host.interface('dummy2')
3842
assert interface.exists
@@ -344,11 +348,13 @@ def test_firewalld_rules(host):
344348
assert expected_line in info
345349
assert expected_line in perm_info
346350

351+
@pytest.mark.skipif(not _is_fail2ban_enabled(), reason="fail2ban not enabled")
347352
def test_fail2ban_running(host):
348353
assert host.package("fail2ban").is_installed
349354
assert host.service("fail2ban.service").is_enabled
350355
assert host.service("fail2ban.service").is_running
351356

357+
@pytest.mark.skipif(not _is_fail2ban_enabled(), reason="fail2ban not enabled")
352358
def test_fail2ban_default_jail_config(host):
353359
# verify that sshd jail is enabled by default
354360
status = host.check_output("sudo fail2ban-client status sshd")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
features:
3+
- |
4+
The OS distribution and release used to build IPA images can now
5+
be customised using the `ipa_build_distro` and `ipa_build_release`
6+
overrides.

zuul.d/jobs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
is_slurp: "{{ 'slurp' in zuul.job }}"
108108
previous_release: "{{ '2025.1' if is_slurp else '2025.2' }}"
109109
tls_enabled: false
110+
fail2ban_enabled: false
110111
container_engine: 'docker'
111112
ci_network_engine: default
112113
ironic_boot_mode: "bios"

0 commit comments

Comments
 (0)