From 0aa69d76d42e97e074b27afbc6dd7ec76aad6f4b Mon Sep 17 00:00:00 2001 From: Arvind Jangir Date: Mon, 25 May 2026 19:23:23 +0530 Subject: [PATCH] httpboot feature for proxy --- src/features.yaml | 4 ++++ src/roles/foreman_proxy/defaults/main.yaml | 3 +++ .../foreman_proxy/tasks/feature/httpboot.yaml | 19 +++++++++++++++++++ .../templates/settings.d/httpboot.yml.j2 | 3 +++ tests/foreman_proxy_test.py | 4 ++++ 5 files changed, 33 insertions(+) create mode 100644 src/roles/foreman_proxy/tasks/feature/httpboot.yaml create mode 100644 src/roles/foreman_proxy/templates/settings.d/httpboot.yml.j2 diff --git a/src/features.yaml b/src/features.yaml index f8284b019..bd782ba03 100644 --- a/src/features.yaml +++ b/src/features.yaml @@ -48,3 +48,7 @@ bmc: description: Power management for bare metal hosts (IPMI, Redfish) foreman_proxy: plugin_name: bmc +httpboot: + description: UEFI HTTP Boot provisioning support + foreman_proxy: + plugin_name: httpboot diff --git a/src/roles/foreman_proxy/defaults/main.yaml b/src/roles/foreman_proxy/defaults/main.yaml index cb62496ac..0ed6bd589 100644 --- a/src/roles/foreman_proxy/defaults/main.yaml +++ b/src/roles/foreman_proxy/defaults/main.yaml @@ -23,3 +23,6 @@ foreman_proxy_foreman_server_url: "https://{{ ansible_facts['fqdn'] }}" # BMC settings foreman_proxy_bmc_ipmi_implementation: ipmitool foreman_proxy_bmc_redfish_verify_ssl: true + +# HTTPBoot settings +foreman_proxy_httpboot_root_dir: /var/lib/tftpboot diff --git a/src/roles/foreman_proxy/tasks/feature/httpboot.yaml b/src/roles/foreman_proxy/tasks/feature/httpboot.yaml new file mode 100644 index 000000000..ea412f13c --- /dev/null +++ b/src/roles/foreman_proxy/tasks/feature/httpboot.yaml @@ -0,0 +1,19 @@ +--- +- name: Check if httpboot root directory exists + ansible.builtin.stat: + path: "{{ foreman_proxy_httpboot_root_dir }}" + register: _foreman_proxy_httpboot_root_dir + +- name: Mount httpboot root directory + ansible.builtin.copy: + dest: /etc/containers/systemd/foreman-proxy.container.d/httpboot-volume.conf + content: | + [Container] + Volume={{ foreman_proxy_httpboot_root_dir }}:{{ foreman_proxy_httpboot_root_dir }}:z + mode: '0644' + owner: root + group: root + when: _foreman_proxy_httpboot_root_dir.stat.exists + notify: + - Restart Foreman Proxy + - Refresh Foreman Proxy diff --git a/src/roles/foreman_proxy/templates/settings.d/httpboot.yml.j2 b/src/roles/foreman_proxy/templates/settings.d/httpboot.yml.j2 new file mode 100644 index 000000000..3cd272a38 --- /dev/null +++ b/src/roles/foreman_proxy/templates/settings.d/httpboot.yml.j2 @@ -0,0 +1,3 @@ +--- +:enabled: {{ feature_enabled }} +:root_dir: {{ foreman_proxy_httpboot_root_dir }} diff --git a/tests/foreman_proxy_test.py b/tests/foreman_proxy_test.py index 71ad8cbc0..9a4557065 100644 --- a/tests/foreman_proxy_test.py +++ b/tests/foreman_proxy_test.py @@ -29,6 +29,10 @@ def test_foreman_proxy_features(server, certificates, server_fqdn, enabled_featu assert "bmc" in features else: assert "bmc" not in features + if 'httpboot' in enabled_features: + assert "httpboot" in features + else: + assert "httpboot" not in features def test_foreman_proxy_service(server):