From 7a758abee419cd37b9357aed31ed4f6f6bf9cd70 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 10 Jun 2026 16:22:01 +0200 Subject: [PATCH 01/11] 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 | 9 +++++++++ src/roles/foreman_proxy/tasks/main.yaml | 10 ++++++++++ 4 files changed, 39 insertions(+) diff --git a/development/roles/foreman_development/tasks/main.yaml b/development/roles/foreman_development/tasks/main.yaml index 692985917..9b3627022 100644 --- a/development/roles/foreman_development/tasks/main.yaml +++ b/development/roles/foreman_development/tasks/main.yaml @@ -238,6 +238,16 @@ oauth1_consumer_key: "{{ foreman_development_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_development_oauth_consumer_secret }}" 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 b74cc3656..00eab74a7 100644 --- a/src/roles/foreman/tasks/main.yaml +++ b/src/roles/foreman/tasks/main.yaml @@ -325,3 +325,12 @@ register: foreman_tasks_status when: - "'katello' in foreman_status.json['results']" + +- 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 From 36826d4269f21bd27bd584424d281404adad2afc Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Tue, 16 Jun 2026 10:11:50 +0200 Subject: [PATCH 02/11] Move Smart Proxy feature warnings to post-deployment checks Previously, warnings about unrecognized Smart Proxy features were displayed inline during installation as each proxy was registered. Production deployments now check all Smart Proxies in the post_install role using resource_info to query for unrecognized_features. Development deployments check Smart Proxies in a post_task in the deploy-dev playbook. Co-Authored-By: Claude Sonnet 4.5 --- .../playbooks/deploy-dev/deploy-dev.yaml | 21 +++++++++++++++++++ .../roles/foreman_development/tasks/main.yaml | 10 --------- .../tasks/smart-proxy/main.yml | 10 --------- src/roles/foreman_proxy/tasks/main.yaml | 10 --------- src/roles/post_install/tasks/main.yaml | 3 +++ .../tasks/smart_proxy_features_check.yaml | 19 +++++++++++++++++ 6 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 src/roles/post_install/tasks/smart_proxy_features_check.yaml diff --git a/development/playbooks/deploy-dev/deploy-dev.yaml b/development/playbooks/deploy-dev/deploy-dev.yaml index a4214e10e..a11428d27 100644 --- a/development/playbooks/deploy-dev/deploy-dev.yaml +++ b/development/playbooks/deploy-dev/deploy-dev.yaml @@ -64,6 +64,27 @@ name: foreman_development tasks_from: stop-server.yml + - name: Check for unrecognized Smart Proxy features + block: + - name: Get all registered Smart Proxies + theforeman.foreman.resource_info: + server_url: "{{ foreman_development_url }}" + username: "{{ foreman_development_admin_user }}" + password: "{{ foreman_development_admin_password }}" + resource: smart_proxies + full_details: true + register: _deploy_dev_smart_proxies + + - name: Warn about unrecognized Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ item.name }} has features not recognized by Foreman: + {{ item.unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + loop: "{{ _deploy_dev_smart_proxies.resources }}" + when: + - item.unrecognized_features | default([]) | length > 0 + - name: Display development environment information ansible.builtin.debug: msg: | diff --git a/development/roles/foreman_development/tasks/main.yaml b/development/roles/foreman_development/tasks/main.yaml index 9b3627022..692985917 100644 --- a/development/roles/foreman_development/tasks/main.yaml +++ b/development/roles/foreman_development/tasks/main.yaml @@ -238,16 +238,6 @@ oauth1_consumer_key: "{{ foreman_development_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_development_oauth_consumer_secret }}" 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 ce6cbe28d..1e935497b 100644 --- a/development/roles/foreman_development/tasks/smart-proxy/main.yml +++ b/development/roles/foreman_development/tasks/smart-proxy/main.yml @@ -145,16 +145,6 @@ 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_proxy/tasks/main.yaml b/src/roles/foreman_proxy/tasks/main.yaml index d87d31e62..8033c9457 100644 --- a/src/roles/foreman_proxy/tasks/main.yaml +++ b/src/roles/foreman_proxy/tasks/main.yaml @@ -74,16 +74,6 @@ 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 diff --git a/src/roles/post_install/tasks/main.yaml b/src/roles/post_install/tasks/main.yaml index e8b049b5e..e285b7504 100644 --- a/src/roles/post_install/tasks/main.yaml +++ b/src/roles/post_install/tasks/main.yaml @@ -1,3 +1,6 @@ --- - name: Run post install tasks ansible.builtin.include_tasks: "{{ flavor }}.yaml" + +- name: Check for unrecognized Smart Proxy features + ansible.builtin.include_tasks: smart_proxy_features_check.yaml diff --git a/src/roles/post_install/tasks/smart_proxy_features_check.yaml b/src/roles/post_install/tasks/smart_proxy_features_check.yaml new file mode 100644 index 000000000..776f2b8cc --- /dev/null +++ b/src/roles/post_install/tasks/smart_proxy_features_check.yaml @@ -0,0 +1,19 @@ +--- +- name: Get all registered Smart Proxies + theforeman.foreman.resource_info: + server_url: "{{ foreman_url }}" + username: "{{ foreman_initial_admin_username }}" + password: "{{ foreman_initial_admin_password }}" + resource: smart_proxies + full_details: true + register: _post_install_smart_proxies + +- name: Warn about unrecognized Smart Proxy features + ansible.builtin.debug: + msg: >- + Proxy {{ item.name }} has features not recognized by Foreman: + {{ item.unrecognized_features | join(', ') }}. + If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + loop: "{{ _post_install_smart_proxies.resources }}" + when: + - item.unrecognized_features | default([]) | length > 0 From 9f140e1c6bc28683b3da08261d5040e806d80f3e Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Tue, 16 Jun 2026 15:47:11 +0200 Subject: [PATCH 03/11] Move Smart Proxy feature warnings to post-deployment checks In production deployments, move the Smart Proxy feature check from inline (immediately after registration) to post-deployment checks. This provides a comprehensive view of all proxy features across all registered proxies. For development deployments, keep the inline checks since the Foreman server is stopped before post-deployment tasks run. The post-deployment check uses OAuth authentication to query the Foreman API, fetching all registered Smart Proxies and checking for unrecognized features in a single consolidated check. --- .../playbooks/deploy-dev/deploy-dev.yaml | 21 ------------------- .../roles/foreman_development/tasks/main.yaml | 10 +++++++++ .../tasks/smart-proxy/main.yml | 10 +++++++++ src/roles/post_install/tasks/main.yaml | 3 +++ .../tasks/smart_proxy_features_check.yaml | 7 ++++--- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/development/playbooks/deploy-dev/deploy-dev.yaml b/development/playbooks/deploy-dev/deploy-dev.yaml index a11428d27..a4214e10e 100644 --- a/development/playbooks/deploy-dev/deploy-dev.yaml +++ b/development/playbooks/deploy-dev/deploy-dev.yaml @@ -64,27 +64,6 @@ name: foreman_development tasks_from: stop-server.yml - - name: Check for unrecognized Smart Proxy features - block: - - name: Get all registered Smart Proxies - theforeman.foreman.resource_info: - server_url: "{{ foreman_development_url }}" - username: "{{ foreman_development_admin_user }}" - password: "{{ foreman_development_admin_password }}" - resource: smart_proxies - full_details: true - register: _deploy_dev_smart_proxies - - - name: Warn about unrecognized Smart Proxy features - ansible.builtin.debug: - msg: >- - Proxy {{ item.name }} has features not recognized by Foreman: - {{ item.unrecognized_features | join(', ') }}. - If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. - loop: "{{ _deploy_dev_smart_proxies.resources }}" - when: - - item.unrecognized_features | default([]) | length > 0 - - name: Display development environment information ansible.builtin.debug: msg: | diff --git a/development/roles/foreman_development/tasks/main.yaml b/development/roles/foreman_development/tasks/main.yaml index 692985917..5dd050817 100644 --- a/development/roles/foreman_development/tasks/main.yaml +++ b/development/roles/foreman_development/tasks/main.yaml @@ -238,6 +238,16 @@ oauth1_consumer_key: "{{ foreman_development_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_development_oauth_consumer_secret }}" 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..fd93bedb4 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/post_install/tasks/main.yaml b/src/roles/post_install/tasks/main.yaml index e285b7504..b72eff3f8 100644 --- a/src/roles/post_install/tasks/main.yaml +++ b/src/roles/post_install/tasks/main.yaml @@ -4,3 +4,6 @@ - name: Check for unrecognized Smart Proxy features ansible.builtin.include_tasks: smart_proxy_features_check.yaml + vars: + foreman_server_url: "{{ foreman_url }}" + foreman_ca_path: "{{ foreman_ca_certificate }}" diff --git a/src/roles/post_install/tasks/smart_proxy_features_check.yaml b/src/roles/post_install/tasks/smart_proxy_features_check.yaml index 776f2b8cc..cce782c1b 100644 --- a/src/roles/post_install/tasks/smart_proxy_features_check.yaml +++ b/src/roles/post_install/tasks/smart_proxy_features_check.yaml @@ -1,9 +1,10 @@ --- - name: Get all registered Smart Proxies theforeman.foreman.resource_info: - server_url: "{{ foreman_url }}" - username: "{{ foreman_initial_admin_username }}" - password: "{{ foreman_initial_admin_password }}" + server_url: "{{ foreman_server_url }}" + oauth1_consumer_key: "{{ foreman_oauth_consumer_key }}" + oauth1_consumer_secret: "{{ foreman_oauth_consumer_secret }}" + ca_path: "{{ foreman_ca_path }}" resource: smart_proxies full_details: true register: _post_install_smart_proxies From e6c1cbf23cff9a1bd29d5835bbf9c15cb40e885f Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 17 Jun 2026 12:35:50 +0200 Subject: [PATCH 04/11] Improve Smart Proxy feature warning message Reword the warning to use foremanctl terminology and provide both resolution paths: enable matching features in foremanctl or disable them on the proxy. Co-Authored-By: Claude Sonnet 4.5 --- src/roles/post_install/tasks/smart_proxy_features_check.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/roles/post_install/tasks/smart_proxy_features_check.yaml b/src/roles/post_install/tasks/smart_proxy_features_check.yaml index cce782c1b..32238705b 100644 --- a/src/roles/post_install/tasks/smart_proxy_features_check.yaml +++ b/src/roles/post_install/tasks/smart_proxy_features_check.yaml @@ -12,9 +12,8 @@ - name: Warn about unrecognized Smart Proxy features ansible.builtin.debug: msg: >- - Proxy {{ item.name }} has features not recognized by Foreman: - {{ item.unrecognized_features | join(', ') }}. - If these features come from a Smart Proxy plugin, make sure Foreman has the plugin installed too. + Proxy {{ item.name }} reports unrecognized features: {{ item.unrecognized_features | join(', ') }}. + Enable matching features in foremanctl or disable them on the proxy. loop: "{{ _post_install_smart_proxies.resources }}" when: - item.unrecognized_features | default([]) | length > 0 From efe28b06b6dbb6b0edb5ed6e68d5b776dfc8c9c4 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 2 Jul 2026 09:15:44 +0200 Subject: [PATCH 05/11] Scope post_install role variables properly Variables used in smart_proxy_features_check.yaml must follow the role-scoped naming convention (post_install_*) per project rules. Co-Authored-By: Claude Sonnet 4.6 --- src/roles/post_install/tasks/main.yaml | 6 ++++-- .../post_install/tasks/smart_proxy_features_check.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/roles/post_install/tasks/main.yaml b/src/roles/post_install/tasks/main.yaml index b72eff3f8..9fc3095b1 100644 --- a/src/roles/post_install/tasks/main.yaml +++ b/src/roles/post_install/tasks/main.yaml @@ -5,5 +5,7 @@ - name: Check for unrecognized Smart Proxy features ansible.builtin.include_tasks: smart_proxy_features_check.yaml vars: - foreman_server_url: "{{ foreman_url }}" - foreman_ca_path: "{{ foreman_ca_certificate }}" + post_install_foreman_server_url: "{{ foreman_url }}" + post_install_foreman_ca_path: "{{ foreman_ca_certificate }}" + post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}" + post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}" diff --git a/src/roles/post_install/tasks/smart_proxy_features_check.yaml b/src/roles/post_install/tasks/smart_proxy_features_check.yaml index 32238705b..0792ffea0 100644 --- a/src/roles/post_install/tasks/smart_proxy_features_check.yaml +++ b/src/roles/post_install/tasks/smart_proxy_features_check.yaml @@ -1,10 +1,10 @@ --- - name: Get all registered Smart Proxies theforeman.foreman.resource_info: - server_url: "{{ foreman_server_url }}" - oauth1_consumer_key: "{{ foreman_oauth_consumer_key }}" - oauth1_consumer_secret: "{{ foreman_oauth_consumer_secret }}" - ca_path: "{{ foreman_ca_path }}" + server_url: "{{ post_install_foreman_server_url }}" + oauth1_consumer_key: "{{ post_install_foreman_oauth_consumer_key }}" + oauth1_consumer_secret: "{{ post_install_foreman_oauth_consumer_secret }}" + ca_path: "{{ post_install_foreman_ca_path }}" resource: smart_proxies full_details: true register: _post_install_smart_proxies From 7ec071c0aaad7cf02ecdd46d09f8bdb9a2163f1d Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 2 Jul 2026 13:46:33 +0200 Subject: [PATCH 06/11] Scope post_install role variables properly, vol. 2 --- src/playbooks/deploy/deploy.yaml | 9 ++++++++- src/roles/post_install/tasks/main.yaml | 5 ----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index bd3304cb7..e246117ea 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -42,4 +42,11 @@ - role: hammer when: - "'hammer' in enabled_features" - - post_install + - role: post_install + vars: + post_install_foreman_ca_path: "{{ foreman_ca_certificate }}" + post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}" + post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}" + post_install_foreman_server_url: "{{ foreman_url }}" + post_install_foreman_initial_admin_password: "{{ foreman_initial_admin_password }}" + post_install_foreman_initial_admin_username: "{{ foreman_initial_admin_username }}" diff --git a/src/roles/post_install/tasks/main.yaml b/src/roles/post_install/tasks/main.yaml index 9fc3095b1..e285b7504 100644 --- a/src/roles/post_install/tasks/main.yaml +++ b/src/roles/post_install/tasks/main.yaml @@ -4,8 +4,3 @@ - name: Check for unrecognized Smart Proxy features ansible.builtin.include_tasks: smart_proxy_features_check.yaml - vars: - post_install_foreman_server_url: "{{ foreman_url }}" - post_install_foreman_ca_path: "{{ foreman_ca_certificate }}" - post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}" - post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}" From c1614b39faec764d1ecad187c1ec558714324f4a Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 2 Jul 2026 16:30:00 +0200 Subject: [PATCH 07/11] Scope post_install role variables properly, vol. 3 --- src/roles/post_install/tasks/katello.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/roles/post_install/tasks/katello.yaml b/src/roles/post_install/tasks/katello.yaml index 6327e77ac..5db3275e7 100644 --- a/src/roles/post_install/tasks/katello.yaml +++ b/src/roles/post_install/tasks/katello.yaml @@ -5,8 +5,8 @@ - "{{ _post_install_url_msg }}" - "{{ _post_install_cred_msg if (post_install_done_flag is not exists) else '' }}" vars: - _post_install_url_msg: "Foreman is running at {{ foreman_url }}" - _post_install_cred_msg: "Admin credentials: {{ foreman_initial_admin_username }}:{{ foreman_initial_admin_password }}" + _post_install_url_msg: "Foreman is running at {{ post_install_foreman_server_url }}" + _post_install_cred_msg: "Admin credentials: {{ post_install_foreman_initial_admin_username }}:{{ post_install_foreman_initial_admin_password }}" - name: Mark installation as complete ansible.builtin.copy: dest: "{{ post_install_done_flag }}" From 72bb8a0b09bca80e6c3182d36e6061dfbed18534 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Fri, 3 Jul 2026 15:25:35 +0200 Subject: [PATCH 08/11] Omit ca path if unknown --- src/roles/post_install/tasks/smart_proxy_features_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roles/post_install/tasks/smart_proxy_features_check.yaml b/src/roles/post_install/tasks/smart_proxy_features_check.yaml index 0792ffea0..0d99854cc 100644 --- a/src/roles/post_install/tasks/smart_proxy_features_check.yaml +++ b/src/roles/post_install/tasks/smart_proxy_features_check.yaml @@ -4,7 +4,7 @@ server_url: "{{ post_install_foreman_server_url }}" oauth1_consumer_key: "{{ post_install_foreman_oauth_consumer_key }}" oauth1_consumer_secret: "{{ post_install_foreman_oauth_consumer_secret }}" - ca_path: "{{ post_install_foreman_ca_path }}" + ca_path: "{{ post_install_foreman_ca_path | default(omit) }}" resource: smart_proxies full_details: true register: _post_install_smart_proxies From 2ea41cf29f05bdbd5c538afd51dd17bed1af9019 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Fri, 3 Jul 2026 17:21:41 +0200 Subject: [PATCH 09/11] Fallback to foreman_proxy_* --- src/playbooks/deploy/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index e246117ea..e65f034b8 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -44,9 +44,9 @@ - "'hammer' in enabled_features" - role: post_install vars: - post_install_foreman_ca_path: "{{ foreman_ca_certificate }}" - post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}" - post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}" - post_install_foreman_server_url: "{{ foreman_url }}" + post_install_foreman_ca_path: "{{ foreman_ca_certificate | default(foreman_proxy_foreman_ca_certificate) }}" + post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key | default(foreman_proxy_oauth_consumer_key) }}" + post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret | default(foreman_proxy_oauth_consumer_secret) }}" + post_install_foreman_server_url: "{{ foreman_url | default(foreman_proxy_foreman_server_url) }}" post_install_foreman_initial_admin_password: "{{ foreman_initial_admin_password }}" post_install_foreman_initial_admin_username: "{{ foreman_initial_admin_username }}" From e6856499ed6f3c15af8e72f4c56c5c79ae8ab736 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 9 Jul 2026 11:23:25 +0200 Subject: [PATCH 10/11] Pass post_install vars in deploy-proxy playbook Co-Authored-By: Claude Sonnet 4.6 --- src/playbooks/deploy-proxy/deploy-proxy.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/playbooks/deploy-proxy/deploy-proxy.yaml b/src/playbooks/deploy-proxy/deploy-proxy.yaml index 6ea0967e8..889b321f3 100644 --- a/src/playbooks/deploy-proxy/deploy-proxy.yaml +++ b/src/playbooks/deploy-proxy/deploy-proxy.yaml @@ -31,4 +31,9 @@ - pulp - systemd_target - foreman_proxy - - post_install + - role: post_install + vars: + post_install_foreman_ca_path: "{{ foreman_proxy_foreman_ca_certificate | default(omit) }}" + post_install_foreman_oauth_consumer_key: "{{ foreman_proxy_oauth_consumer_key }}" + post_install_foreman_oauth_consumer_secret: "{{ foreman_proxy_oauth_consumer_secret }}" + post_install_foreman_server_url: "{{ foreman_proxy_foreman_server_url }}" From 07a738871a71374280598601da702536d4080536 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 9 Jul 2026 11:24:29 +0200 Subject: [PATCH 11/11] Remove unnecessary fallbacks in deploy playbook post_install vars Co-Authored-By: Claude Sonnet 4.6 --- src/playbooks/deploy/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index e65f034b8..e246117ea 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -44,9 +44,9 @@ - "'hammer' in enabled_features" - role: post_install vars: - post_install_foreman_ca_path: "{{ foreman_ca_certificate | default(foreman_proxy_foreman_ca_certificate) }}" - post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key | default(foreman_proxy_oauth_consumer_key) }}" - post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret | default(foreman_proxy_oauth_consumer_secret) }}" - post_install_foreman_server_url: "{{ foreman_url | default(foreman_proxy_foreman_server_url) }}" + post_install_foreman_ca_path: "{{ foreman_ca_certificate }}" + post_install_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}" + post_install_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}" + post_install_foreman_server_url: "{{ foreman_url }}" post_install_foreman_initial_admin_password: "{{ foreman_initial_admin_password }}" post_install_foreman_initial_admin_username: "{{ foreman_initial_admin_username }}"