Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Adds pulp_content_host variable to specify custom hostname and port
Browse files Browse the repository at this point in the history
for CONTENT_HOST server app bindings.

closes #4352
https://pulp.plan.io/issues/4352
  • Loading branch information
rochacbruno committed Feb 4, 2019
1 parent 96c82af commit 4e7a5d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions roles/pulp3-content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ pulp3-content

Install, configure, and set the state of pulp content app.

Variables:
----------

* `pulp_content_host`: **Optional**. host and port where Pulp content app is served.

This variable will be set as the value of `CONTENT_HOST` config in `{{pulp_config_dir}}/settings.py` as the base path to build content URLs and also is the value passed to the `--bind` parameter of the `pulpcore.content` gunicorn service.

Shared variables:
-----------------

Expand Down
2 changes: 2 additions & 0 deletions roles/pulp3-content/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
pulp_content_host: 'localhost:8080'
2 changes: 1 addition & 1 deletion roles/pulp3-content/templates/pulp_content_app.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ User={{ pulp_user }}
WorkingDirectory=/var/run/pulp_content_app/
RuntimeDirectory=pulp_content_app
ExecStart={{ pulp_install_dir }}/bin/gunicorn pulpcore.content:server \
--bind 'localhost:8080' \
--bind '{{ pulp_content_host }}' \
--worker-class 'aiohttp.GunicornWebWorker' \
-w 2

Expand Down
4 changes: 4 additions & 0 deletions roles/pulp3/templates/settings.py.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
DATABASES = {{ pulp_database_config | to_json }}

SECRET_KEY = '{{ pulp_secret_key }}'

{% if pulp_content_host is defined %}
CONTENT_HOST = '{{ pulp_content_host }}'
{% endif %}

0 comments on commit 4e7a5d8

Please sign in to comment.