Add KEA DHCP provider feature for foreman-proxy#531
Conversation
Adds the dhcp-kea-external feature to enable Smart Proxy integration with external KEA DHCP servers.
| description: Power management for bare metal hosts (IPMI, Redfish) | ||
| foreman_proxy: | ||
| plugin_name: bmc | ||
| dhcp-kea-external: |
There was a problem hiding this comment.
I think the feature should be "dhcp" and then you add a parameter to select which provider to use, with kea being one of the answers
There was a problem hiding this comment.
makes way more sense to have a single dhcp feature with a provider parameter
There was a problem hiding this comment.
I played with that thought in #532 for the DNS side of things, would love to hear your opinion on the approach I took
| foreman_proxy_bmc_redfish_verify_ssl: true | ||
|
|
||
| # KEA DHCP settings (external unmanaged server) | ||
| foreman_proxy_dhcp_kea_server: localhost |
There was a problem hiding this comment.
What are the chances that localhost is a place where a Kea will actually run (outside of development setups)?
I think we should leave that undef (like in https://github.com/theforeman/foremanctl/pull/523/changes) and force the user to set a sensible value.
|
|
||
| :enabled: {{ feature_enabled }} | ||
| :use_provider: dhcp_kea_api | ||
| :server: {{ foreman_proxy_dhcp_kea_server }} |
There was a problem hiding this comment.
where does this come from? I don't see such an option in https://gitlab.surrey.ac.uk/sm0049/smart-proxy-dhcp-kea-api/
There was a problem hiding this comment.
yeah, i was just playing around with few things, needed to look again, the reason i added that in draft but thanks for reviews, also i tryna fix few things with the updated changes.
| :enabled: {{ feature_enabled }} | ||
| :use_provider: dhcp_kea_api | ||
| :server: {{ foreman_proxy_dhcp_kea_server }} | ||
| :kea_url: {{ foreman_proxy_dhcp_kea_url }} |
There was a problem hiding this comment.
also, we need kea_api_username and kea_api_password
| :use_provider: dhcp_kea_api | ||
| :server: {{ foreman_proxy_dhcp_kea_server }} | ||
| :kea_url: {{ foreman_proxy_dhcp_kea_url }} | ||
| :kea_subnet: {{ foreman_proxy_dhcp_kea_subnet }} |
There was a problem hiding this comment.
where does this come from? I don't see such an option in https://gitlab.surrey.ac.uk/sm0049/smart-proxy-dhcp-kea-api/
|
Shall we package https://gitlab.surrey.ac.uk/sm0049/smart-proxy-dhcp-kea-api until we figure out whether we want to merge it into core or not? |
Yeah, I was thinking we can package it for now, that will be independent of our decision about potentially merging it into the core later. |
| foreman_proxy_bmc_redfish_verify_ssl: true | ||
|
|
||
| # DHCP settings | ||
| foreman_proxy_dhcp_provider: dhcp_kea_api |
There was a problem hiding this comment.
Why not just:
| foreman_proxy_dhcp_provider: dhcp_kea_api | |
| foreman_proxy_dhcp_provider: dhcp_kea |
| :kea_api_password: {{ foreman_proxy_dhcp_kea_api_password }} | ||
| {% endif %} | ||
| {% if foreman_proxy_dhcp_kea_managed_subnets is defined and foreman_proxy_dhcp_kea_managed_subnets %} | ||
| :managed_subnets: |
There was a problem hiding this comment.
There is a definition of subnets in DHCP as well: https://github.com/theforeman/smart-proxy/blob/develop/config/settings.d/dhcp.yml.example
| foreman_proxy_dhcp_kea_api_url: "{{ undef(hint='You must specify the KEA API URL') }}" | ||
| foreman_proxy_dhcp_kea_api_username: "" | ||
| foreman_proxy_dhcp_kea_api_password: "" | ||
| foreman_proxy_dhcp_kea_managed_subnets: [] |
There was a problem hiding this comment.
I think this should be:
| foreman_proxy_dhcp_kea_managed_subnets: [] | |
| foreman_proxy_dhcp_subnets: [] |
as in https://github.com/theforeman/smart-proxy/blob/develop/config/settings.d/dhcp.yml.example
Do you want to do it, or shall I? |
I'll do it |
053aa03 to
715b2e0
Compare
|
Update: Following the refinement session, we decided to integrate the KEA DHCP provider directly into smart-proxy core rather than packaging it as an external gem. I'm on it. So keeping this into draft till then. Also looking at the current CI test failures, I believe they are coming from IOP tests failures and are unrelated to the DHCP feature changes in this PR. |
Why are you introducing these changes? (Problem description, related links)
ISC DHCP reached end-of-life in October 2022 and has been removed from RHEL 10. This adds support for KEA DHCP as the replacement.
What are the changes introduced in this pull request?
dhcp-kea-externalfeature definition tosrc/features.yamldhcp_kea_api.yml.j2How to test this pull request
Steps to reproduce:
./foremanctl features | grep dhcp-kea-external./foremanctl deploy --add-feature dhcp-kea-external./foremanctl features --list-enabled | grep dhcp-kea-externalpodman exec foreman-proxy ls -la /etc/foreman-proxy/settings.d/dhcp_kea_api.ymlpython -m pytest tests/foreman_proxy_test.py::test_dhcp_kea_feature_present -vChecklist