Story #5290
As a plugin writer, I can provide all of my settings with their defaults in one place.
100%
Description
Problem¶
Currently pulp_ansible has several settings. There isn't a consolidated way currently for dynaconf to overlay settings from the pulp_ansible codebase onto the settings file provided by pulpcore.app.settings
Solution¶
1. Document in the plugin writer's guide a convention that settings should live in pluginname.app.settings
2. Then here you build the list of python paths to the settings file.
3. Then here you have dynaconf load those settings.
This needs to come with documentation for plugin writers and a release note in pulpcore-plugin, even though the changes will mostly occur in pulpcore.
Associated revisions
Revision 00bbe2ca
View on GitHub
Add load of plugin default settings.
- Includes default settings from `{plugin_name}/app/settings.py`
- This settings overrides the data existing in `/etc/pulp/settings.py`
- This settings are overridden by env vars prefixed with `PULP_`
- So a good practice for plugin writers is to prefix the default configs with plugin name such as `RPM`, `FILE`, `ANSIBLE` etc...
example:
`ANSIBLE_SOMEKEY = 'value'` on settings.py can be overriden via `export PULP_ANSIBLE_SOMEKEY='othervalue'`
closes #5290
Revision 2120cd3b
View on GitHub
Add settings.py.j2 for plugin settings
Plugins now have their settings loaded when placed in the file at
``<your plugin>.app.settings.py``.
Revision d2af5393
View on GitHub
Add docs on programatic plugin settings
Plugin writers can add settings programatically using the docs provided
with this commit.
History
#1
Updated by rochacbruno 4 months ago
Dynaconf issue: https://github.com/rochacbruno/dynaconf/issues/207
#2
Updated by daviddavis 4 months ago
- Groomed changed from No to Yes
#3
Updated by rochacbruno 4 months ago
Dynaconf PR: https://github.com/rochacbruno/dynaconf/pull/209
That RFC will be included in the next release
#4
Updated by rochacbruno 4 months ago
Dynaconf 2.0.4 released adding support for this issue to be resolved: https://github.com/rochacbruno/dynaconf/releases/tag/2.0.4
#5
Updated by Anonymous 4 months ago
- Status changed from NEW to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|5b41e98d3d7768177531b5be7105e3a011f2aba6.
#9
Updated by Anonymous 3 months ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|157facaefb1d10e4ead25bb4ef89e39dfb7f1f1d.
#12
Updated by bmbouter 3 months ago
- Status changed from ASSIGNED to POST
docs PR available at: https://github.com/pulp/pulpcore-plugin/pull/124
#13
Updated by bmbouter 3 months ago
- Status changed from POST to MODIFIED
Applied in changeset plugin_template|2120cd3bb4973cb430c1c35dbad5c031f05a20cd.
#14
Updated by bmbouter 3 months ago
- Status changed from MODIFIED to POST
PR for settings.py added to plugin_template: https://github.com/pulp/plugin_template/pull/104
Bringing back to POST for the docs PR to merge and move to MODIFIED.
#15
Updated by bmbouter 3 months ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore-plugin|d2af53939a82933f0fb2a92962f44fa9de688f7b.
Please register to edit this issue