Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ jobs:
--add-feature google \
--add-feature remote-execution \
--add-feature bmc \
--add-feature templates \
${{ matrix.iop == 'enabled' && '--add-feature iop' || '' }}
- name: Run tests
run: |
Expand Down
5 changes: 3 additions & 2 deletions docs/user/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ There are multiple use cases from the users perspective that dictate what parame
| --------- | ----------- | ---------------------------- |
| `--bmc-ipmi-implementation` | IPMI implementation to use for BMC | `--foreman-proxy-bmc-default-provider` |
| `--bmc-redfish-verify-ssl` | Verify SSL certificates for Redfish BMC connections | `--foreman-proxy-bmc-redfish-verify-ssl` |
| `--add-feature templates` | Enable Templates feature on Smart Proxy | `--foreman-proxy-templates` |
| `--templates-listen-on` | Templates proxy to listen on https, http, or both | `--foreman-proxy-templates-listen-on` |
| `--template-url` | URL that hosts will use to contact the proxy for provisioning templates | `--foreman-proxy-template-url` |

### Undetermined

Expand Down Expand Up @@ -185,8 +188,6 @@ There are multiple use cases from the users perspective that dictate what parame
| `--foreman-proxy-realm-provider` | | | |
| `--foreman-proxy-registration` | | | |
| `--foreman-proxy-registration-url` | | | |
| `--foreman-proxy-templates` | | | |
| `--foreman-proxy-template-url` | | | |
| `--puppet-server` | | puppet | server |
| `--puppet-server-ca` | | puppet | server_ca |
| `--puppet-dns-alt-names` | | puppet | dns_alt_names |
Expand Down
4 changes: 4 additions & 0 deletions src/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ bmc:
description: Power management for bare metal hosts (IPMI, Redfish)
foreman_proxy:
plugin_name: bmc
templates:
description: Templates feature for foreman-proxy
foreman_proxy:
plugin_name: templates
10 changes: 10 additions & 0 deletions src/playbooks/deploy/metadata.obsah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ variables:
parameter: --bmc-redfish-verify-ssl
help: Verify SSL certificates for Redfish BMC connections.
type: Boolean
foreman_proxy_templates_listen_on:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using templates and template which is confusing to as a user, let's pick one and be consistent. I also wonder if we should lean into using the word "provisioning" here as I have heard users be confused about the kind of templates that are used throughout Foreman.

parameter: --templates-listen-on
help: Templates proxy to listen on https, http, or both.
choices:
- http
- https
- both
foreman_proxy_template_url:
parameter: --template-url
help: URL that hosts will use to contact the proxy for provisioning templates. Defaults to http://<proxy-fqdn>:8000.

constraints:
required_together:
Expand Down
3 changes: 3 additions & 0 deletions src/roles/foreman_proxy/templates/settings.d/templates.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
:enabled: {{ feature_enabled }}
:template_url: {{ foreman_proxy_template_url | default('http://' + ansible_facts['fqdn'] + ':8000') }}
17 changes: 17 additions & 0 deletions tests/foreman_proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 'templates' in enabled_features:
assert "templates" in features
else:
assert "templates" not in features


def test_foreman_proxy_service(server):
Expand Down Expand Up @@ -69,3 +73,16 @@ def test_bmc_capabilities(proxy_v2_features):
def test_bmc_default_provider(proxy_v2_features):
settings = proxy_v2_features['bmc'].get('settings', {})
assert settings.get('bmc_default_provider') == 'ipmitool'


@pytest.mark.feature('templates')
def test_templates_feature_enabled(proxy_v2_features):
assert 'templates' in proxy_v2_features


@pytest.mark.feature('templates')
def test_templates_template_url(proxy_v2_features, server_fqdn):
settings = proxy_v2_features['templates'].get('settings', {})
template_url = settings.get('template_url')
assert template_url == f'http://{server_fqdn}:8000'

Loading