Skip to content

Commit 43b4e83

Browse files
jeremylenzclaude
andcommitted
Add Registration smart proxy feature (SAT-44972)
Implements host registration through the smart proxy with HTTPS-only support and Templates dependency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6bb3f24 commit 43b4e83

8 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ jobs:
152152
--add-feature google \
153153
--add-feature remote-execution \
154154
--add-feature bmc \
155+
--add-feature registration \
156+
--registration-url https://quadlet.example.com:8443 \
155157
${{ matrix.iop == 'enabled' && '--add-feature iop' || '' }}
156158
- name: Run tests
157159
run: |

docs/user/parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ There are multiple use cases from the users perspective that dictate what parame
127127
| `--add-feature content/ostree` | Enable OSTree content type | `--foreman-proxy-content-enable-ostree` |
128128
| `--bmc-ipmi-implementation` | IPMI implementation to use for BMC | `--foreman-proxy-bmc-default-provider` |
129129
| `--bmc-redfish-verify-ssl` | Verify SSL certificates for Redfish BMC connections | `--foreman-proxy-bmc-redfish-verify-ssl` |
130+
| `--add-feature registration` | Enable Registration feature | `--foreman-proxy-registration` |
131+
| `--registration-url` | URL that hosts use to reach the registration endpoint | `--foreman-proxy-registration-url` |
130132

131133
### Undetermined
132134

@@ -197,8 +199,6 @@ There are multiple use cases from the users perspective that dictate what parame
197199
| `--foreman-proxy-realm-keytab` | | | |
198200
| `--foreman-proxy-realm-principal` | | | |
199201
| `--foreman-proxy-realm-provider` | | | |
200-
| `--foreman-proxy-registration` | | | |
201-
| `--foreman-proxy-registration-url` | | | |
202202
| `--foreman-proxy-templates` | | | |
203203
| `--foreman-proxy-template-url` | | | |
204204
| `--puppet-server` | | puppet | server |

src/features.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,13 @@ bmc:
6666
description: Power management for bare metal hosts (IPMI, Redfish)
6767
foreman_proxy:
6868
plugin_name: bmc
69+
templates:
70+
description: Templates feature for foreman-proxy
71+
foreman_proxy:
72+
plugin_name: templates
73+
registration:
74+
description: Host registration feature for foreman-proxy
75+
foreman_proxy:
76+
plugin_name: registration
77+
dependencies:
78+
- templates

src/playbooks/_foreman_proxy/metadata.obsah.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ variables:
1010
parameter: --bmc-redfish-verify-ssl
1111
help: Verify SSL certificates for Redfish BMC connections.
1212
type: Boolean
13+
foreman_proxy_registration_url:
14+
parameter: --registration-url
15+
help: URL that hosts use to reach the registration endpoint (e.g. https://loadbalancer.example.com).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
:enabled: https
3+
{% if foreman_proxy_registration_url is defined %}
4+
:registration_url: {{ foreman_proxy_registration_url }}
5+
{% endif %}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
:enabled: {{ feature_enabled }}

src/vars/flavors/foreman-proxy-content.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ flavor_features:
55
- content/container
66
- content/ansible
77
- content/python
8+
- registration
89

910
pulp_mirror: true
1011

tests/feature/foreman-proxy/base_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def test_foreman_proxy_features(curl_request, proxy_base_url, enabled_features):
2727
assert "bmc" in features
2828
else:
2929
assert "bmc" not in features
30+
if 'registration' in enabled_features:
31+
assert "registration" in features
32+
else:
33+
assert "registration" not in features
3034

3135

3236
def test_foreman_proxy_service(server):
@@ -65,3 +69,10 @@ def test_bmc_capabilities(proxy_v2_features):
6569
def test_bmc_default_provider(proxy_v2_features):
6670
settings = proxy_v2_features['bmc'].get('settings', {})
6771
assert settings.get('bmc_default_provider') == 'ipmitool'
72+
73+
74+
@pytest.mark.feature('registration')
75+
def test_registration_url(proxy_v2_features):
76+
settings = proxy_v2_features['registration'].get('settings', {})
77+
registration_url = settings.get('registration_url')
78+
assert registration_url == 'https://quadlet.example.com:8443'

0 commit comments

Comments
 (0)