-
Notifications
You must be signed in to change notification settings - Fork 416
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
feat(config): use separate defaults for all states #247
base: master
Are you sure you want to change the base?
Conversation
- currently you're forced to define extra states if you opt to install nginx with passenger, if you want the same outcome for passenger and nginx installs with equivalent config - passenger is an extra module on top of nginx, makes no sense to end up with less configuration by default
- In the case that you want to use a custom template for one state, it's _unlikely_ that you want to use the same custom template for another - Although this results in duplicate files, it makes the behaviour of the formula easier to understand, e.g - I specify a custom hard-coded nginx.conf file that I use on all servers. I don't expect it to suddenly be impossible to configure passenger. - Similarly, if I do something custom with server.conf, I don't expect that snippers are affected
I take it back, this cannot be worked around. See the context in slack here: https://saltstackcommunity.slack.com/team/ULFR9ES64 TL;DR if you override the template name with source files, it completely overrides the file switch. Example here: https://github.com/TryGhost/nginx-formula/blob/e957a022763db369dece479479301edaa7223c91/nginx/servers_config.sls#L116 I expected that overriding E.g Instead, it gets rid of the ability to look for the dynamic server name, and only looks for the hardcoded |
Bottom line - the reuse of default templates for multiple states is a severe limitation, you cannot override one default without changing the behaviour of another state. There is no workaround or fix. Meaning you effectively cannot customise the defaults in any way that is intended to tailor them to one state or another - a severe limitation. |
* saltstack-formulas/nginx-formula#247 (comment) - The main issue is that the `nginx-formula` has dynamic values being used by as the default `source_files` -- there is no way to provide this from the pillar/config in a sensible fashion - Prepending to this default (rather than overriding it) resolves this problem entirely, without adding excessive entries to the `source` * Closes saltstack-formulas#151
As discussed in Slack, merging saltstack-formulas/template-formula#152 (and propagating to all formulas) will alleviate these problems. |
* saltstack-formulas/nginx-formula#247 (comment) - The main issue is that the `nginx-formula` has dynamic values being used as the default `source_files` -- there is no way to provide this from the pillar/config in a sensible fashion - Prepending to this default (rather than overriding it) resolves this problem entirely, without adding excessive entries to the `source` * Closes saltstack-formulas#151
Yes saltstack-formulas/template-formula#152 will mean there is at least a workaround. However, it would be ideal if no workaround was necessary :) |
* saltstack-formulas/nginx-formula#247 (comment) - The main issue is that the `nginx-formula` has dynamic values being used as the default `source_files` -- there is no way to provide this from the pillar/config in a sensible fashion - Prepending to this default (rather than overriding it) resolves this problem entirely, without adding excessive entries to the `source` * Closes saltstack-formulas#151
* saltstack-formulas/nginx-formula#247 (comment) - The main issue is that the `nginx-formula` has dynamic values being used as the default `source_files` -- there is no way to provide this from the pillar/config in a sensible fashion - Prepending to this default (rather than overriding it) resolves this problem entirely, without adding excessive entries to the `source` * Closes saltstack-formulas#151
## [3.1.1](v3.1.0...v3.1.1) (2019-07-25) ### Bug Fixes * **tofs:** prepend the config-based `source_files` to the default ([3483e76](3483e76)), closes [/github.com/saltstack-formulas/nginx-formula/pull/247#issuecomment-514262549](https://github.com//github.com/saltstack-formulas/nginx-formula/pull/247/issues/issuecomment-514262549) [#151](#151) ### Documentation * **tofs:** ensure merged will all recent changes ([6a614d9](6a614d9)) * **tofs:** update from `nginx-formula` ([23a221e](23a221e)), closes [/github.com/saltstack-formulas/nginx-formula/pull/238#discussion_r289124365](https://github.com//github.com/saltstack-formulas/nginx-formula/pull/238/issues/discussion_r289124365)
@ErisDS can you please take a look and rebase your pr? |
At the moment this is untested and pure opinion - again happy to do more work if other people agree.
IMO it only makes sense that the defaults are shared, whilst the default templates are in use to reduce duplication.
As soon as you override one of the shared defaults (nginx.conf or server.conf) unexpected things happen:
e.g
This can currently be worked around by specifying your own names for files in tofs.source_files, so the change may be undesirable.
This tripped me up so thought I'd raise to bring it to attention of maintainers.