Skip to content
Merged
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
10 changes: 10 additions & 0 deletions development/roles/foreman_development/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions development/roles/foreman_development/tasks/smart-proxy/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion src/playbooks/deploy-proxy/deploy-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
9 changes: 8 additions & 1 deletion src/playbooks/deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
9 changes: 9 additions & 0 deletions src/roles/foreman/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/roles/post_install/tasks/katello.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
3 changes: 3 additions & 0 deletions src/roles/post_install/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions src/roles/post_install/tasks/smart_proxy_features_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Get all registered Smart Proxies
theforeman.foreman.resource_info:
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 | default(omit) }}"
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 }} 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