Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate pulp_settings in favor of extra_settings #100

Closed
wants to merge 12 commits into from
10 changes: 10 additions & 0 deletions config/crd/bases/galaxy_v1beta1_galaxy_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ spec:
type: boolean
type: object
type: object
extra_settings:
description: Extra settings to specify for Galaxy
items:
properties:
setting:
type: string
value:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
bundle_cacert_secret:
description: Secret where the trusted Certificate Authority Bundle is stored
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Extra Settings
path: extra_settings
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Redis deployment configuration
path: redis
x-descriptors:
Expand Down
26 changes: 26 additions & 0 deletions docs/user-guide/advanced-configuration/extra-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#### Extra Settings

With`extra_settings`, you can pass multiple custom settings via the `galaxy-operator`. The parameter `extra_settings` will be appended to the `/etc/pulp/settings.py` and can be an alternative to the `extra_volumes` parameter.

| Name | Description | Default |
| -------------- | -------------- | ------- |
| extra_settings | Extra settings | '' |

**Note:** Parameters configured in `extra_settings` are set as read-only settings in galaxy. As a result, they cannot be changed in the UI after deployment. If you need to change the setting after the initial deployment, you need to change it on the galaxy CR spec.

Example configuration of `extra_settings` parameter

```yaml
spec:
extra_settings:
- setting: MAX_PAGE_SIZE
value: "500"

- setting: AUTH_LDAP_BIND_DN
value: "cn=admin,dc=example,dc=com"

- setting: LOG_AGGREGATOR_LEVEL
value: "'DEBUG'"
```

Note for some settings, such as `LOG_AGGREGATOR_LEVEL`, the value may need double quotes.
3 changes: 3 additions & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ nav:
- Getting Started:
- Quickstart: quickstart.md
- Build: build.md
- User Guide:
- Advanced Configuration:
- Extra_Settings: user-guide/advanced-configuration/extra-settings.md
- Containers: container.md
- Custom Resources:
- Galaxy:
Expand Down
1 change: 0 additions & 1 deletion roles/galaxy-api/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- k8s_status:
api_version: "{{ api_version }}"
kind: "{{ kind }}"
Expand Down
8 changes: 8 additions & 0 deletions roles/galaxy-config/tasks/combine_galaxy_settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- name: Check settings
assert:
that: pulp_settings is undefined
fail_msg: >-
[WARNING]: pulp_settings: is deprecated and will be removed in a future release.\n
Please use extra_settings: instead.
quiet: true
ignore_errors: true

- name: Getting raw pulp_settings
set_fact:
Expand Down
9 changes: 6 additions & 3 deletions roles/galaxy-config/templates/galaxy-server.secret.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
namespace: "{{ ansible_operator_meta.namespace }}"
stringData:
settings.py: |
{% for setting, value in pulp_combined_settings.items() %}
{{ setting | upper }} = {{ value | string | capitalize if value | string in ["True", "False"] else value | to_json }}
{% endfor %}
{% for setting, value in pulp_combined_settings.items() %}
{{ setting | upper }} = {{ value }}
{% endfor %}
{% for item in extra_settings | default([]) %}
{{ item.setting }} = {{ item.value }}
{% endfor %}