From a2f7446e3daa83e19e18b9e0a36376843237dfac Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 10 Jun 2026 16:22:01 +0200 Subject: [PATCH] Warn about unrecognized smart proxy features Co-Authored-By: Claude Opus 4.7 --- development/roles/foreman_development/tasks/main.yaml | 10 ++++++++++ .../foreman_development/tasks/smart-proxy/main.yml | 10 ++++++++++ src/roles/foreman/tasks/main.yaml | 10 ++++++++++ src/roles/foreman_proxy/tasks/main.yaml | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/development/roles/foreman_development/tasks/main.yaml b/development/roles/foreman_development/tasks/main.yaml index 7f5482a35..138727685 100644 --- a/development/roles/foreman_development/tasks/main.yaml +++ b/development/roles/foreman_development/tasks/main.yaml @@ -235,6 +235,16 @@ username: "{{ foreman_development_admin_user }}" password: "{{ foreman_development_admin_password }}" ca_path: "{{ foreman_development_ca_certificate }}" + register: _foreman_development_pulp_proxy_registration + +- name: Warn about unrecognized Pulp Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ ansible_facts['fqdn'] }}-pulp has features not recognized by Foreman: + {{ _foreman_development_pulp_proxy_registration.entity.smart_proxies[0].unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + when: + - _foreman_development_pulp_proxy_registration.entity.smart_proxies[0].unrecognized_features | default([]) | length > 0 - name: Configure smart-proxy for development ansible.builtin.include_tasks: smart-proxy/main.yml diff --git a/development/roles/foreman_development/tasks/smart-proxy/main.yml b/development/roles/foreman_development/tasks/smart-proxy/main.yml index 1e935497b..ce6cbe28d 100644 --- a/development/roles/foreman_development/tasks/smart-proxy/main.yml +++ b/development/roles/foreman_development/tasks/smart-proxy/main.yml @@ -145,6 +145,16 @@ oauth1_consumer_secret: "{{ foreman_development_oauth_consumer_secret }}" ca_path: "{{ foreman_development_ca_certificate }}" validate_certs: false + register: _foreman_development_proxy_registration + +- name: Warn about unrecognized Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ ansible_facts['fqdn'] }}-dev has features not recognized by Foreman: + {{ _foreman_development_proxy_registration.entity.smart_proxies[0].unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + when: + - _foreman_development_proxy_registration.entity.smart_proxies[0].unrecognized_features | default([]) | length > 0 - name: Stop smart-proxy-development service ansible.builtin.systemd: diff --git a/src/roles/foreman/tasks/main.yaml b/src/roles/foreman/tasks/main.yaml index 3bef53104..ebee406fe 100644 --- a/src/roles/foreman/tasks/main.yaml +++ b/src/roles/foreman/tasks/main.yaml @@ -321,3 +321,13 @@ oauth1_consumer_key: "{{ foreman_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_oauth_consumer_secret }}" ca_path: "{{ foreman_ca_certificate }}" + register: _foreman_pulp_proxy_registration + +- name: Warn about unrecognized Pulp Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ ansible_facts['fqdn'] }}-pulp has features not recognized by Foreman: + {{ _foreman_pulp_proxy_registration.entity.smart_proxies[0].unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + when: + - _foreman_pulp_proxy_registration.entity.smart_proxies[0].unrecognized_features | default([]) | length > 0 diff --git a/src/roles/foreman_proxy/tasks/main.yaml b/src/roles/foreman_proxy/tasks/main.yaml index 8033c9457..d87d31e62 100644 --- a/src/roles/foreman_proxy/tasks/main.yaml +++ b/src/roles/foreman_proxy/tasks/main.yaml @@ -74,6 +74,16 @@ oauth1_consumer_key: "{{ foreman_proxy_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_proxy_oauth_consumer_secret }}" ca_path: "{{ foreman_proxy_foreman_ca_certificate | default(omit) }}" + register: _foreman_proxy_registration + +- name: Warn about unrecognized Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ foreman_proxy_name }} has features not recognized by Foreman: + {{ _foreman_proxy_registration.entity.smart_proxies[0].unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + when: + - _foreman_proxy_registration.entity.smart_proxies[0].unrecognized_features | default([]) | length > 0 - name: Flush handlers to restart services ansible.builtin.meta: flush_handlers