Add apache config support for /pypi#458
Add apache config support for /pypi#458pavanshekar wants to merge 1 commit intotheforeman:masterfrom
Conversation
| ProxyPassReverse {{ httpd_pulp_content_backend }}/pulp/content | ||
| </Location> | ||
|
|
||
| <Location "/pypi"> |
There was a problem hiding this comment.
In foreman-installer this was added conditionally if python content type was enabled. I think we should do the same here so as not to expose routes that have no effect.
There was a problem hiding this comment.
I've updated the template to conditionally include the /pypi Location block only when pulp_python is in the enabled plugins list.
0371840 to
d7b6b8b
Compare
| ProxyPassReverse {{ httpd_pulp_content_backend }}/pulp/content | ||
| </Location> | ||
|
|
||
| {% if 'pulp_python' in (pulp_enabled_plugins | default([])) %} |
There was a problem hiding this comment.
The problem is that this variable is from the pulp role, and this is the httpd role.
@evgeni -- do you think we should go with role variables httpd_pulp_python or we should have Pulp role require/expect httpd, and use our drop in directory to have the pulp role drop in chunks?
There was a problem hiding this comment.
Just checking in on this when you have a moment. Happy to proceed based on your suggestion.
There was a problem hiding this comment.
Jinja has an include tag, so we could do something like:
# httpd/defaults/main.yml
httpd_enabled_pulp_snippets: []
# vhost.conf.j2:
{% for httpd_pulp_snippet in httpd_enabled_pulp_snippets %}
{% include httpd_pulp_snippet+'.j2' %}
{% endfor %}
and then feed httpd_enabled_pulp_snippets with the right list of enabled pulp plugins at the foremanctl level (and of course provide those snippets)
There was a problem hiding this comment.
Thanks! Implemented using httpd_enabled_pulp_snippets with includes as suggested.
d7b6b8b to
be8c44d
Compare
| httpd_client_ca_certificate: "{{ client_ca_certificate }}" | ||
| httpd_server_certificate: "{{ server_certificate }}" | ||
| httpd_server_key: "{{ server_key }}" | ||
| httpd_enabled_pulp_snippets: "{{ ['pypi'] if 'pulp_python' in pulp_enabled_plugins else [] }}" |
There was a problem hiding this comment.
I think here we need to tie this into our features. For example, see
And you can look down at line 32 in this file to see it being referenced.
@evgeni -- did we have an intent to define "meta" features within the features.yaml? e.g. content/* features
Why are you introducing these changes? (Problem description, related links)
Add Apache config support for /pypi in foremanctl
Fixes SAT-44475
What are the changes introduced in this pull request?
<Location "/pypi">block inforeman-ssl-vhost.conf.j2to proxy requests to Pulp API backendHow to test this pull request
Steps to reproduce:
grep -A 6 'Location "/pypi"' /etc/httpd/conf.d/foreman-ssl.confChecklist