Allow uWSGI configuration entirely through attributes#233
Conversation
This is necessary because uWSGI has many flags, which exceed the scope of this cookbook. Instead of supporting every single possible flag with logic, support any possibility with attributes, override attributes, and the like. One single hash contains all the information for the uWSGI configuration file. Example: The key is rendered as '--flag' and the value is rendered as 'val' EG: default['graphite']['uwsgi']['config']['key'] = 'val' --key val Integers are cast to strings Arrays repeat the flag name, such as default['graphite']['uwsgi']['config']['pythonpath'] = [foo, bar] --pythonpath foo --pythonpath bar If a value is set to Boolean type true, the flag is simply stated EG: default['graphite']['uwsgi']['config']['master'] = true --master
This is necessary because uWSGI has many flags, which exceed the scope of this cookbook. Instead of supporting every single possible flag with logic, support any possibility with attributes, override attributes, and the like. One single hash contains all the information for the uWSGI configuration file. Example: The key is rendered as '--flag' and the value is rendered as 'val' EG: default['graphite']['uwsgi']['config']['key'] = 'val' --key val Integers are cast to strings Arrays repeat the flag name, such as default['graphite']['uwsgi']['config']['pythonpath'] = [foo, bar] --pythonpath foo --pythonpath bar If a value is set to Boolean type true, the flag is simply stated EG: default['graphite']['uwsgi']['config']['master'] = true --master
|
Thanks for the for @sethdmoore we're looking at rewriting this as a custom resource. And the general consensus in this case is to not use attributes As you suggest it's pretty hard/pointless to cater for every config in some files. A pattern we've been using elsewhere is the extra options Hash, where anything we haven't covered in the normal/common options is covered there See the HAProxy cookbook for an example If you want to discuss this more, please head over to #276 and we'll find a solution that's good for maintenance and usability. As a result I'm going to close this PR down for now. Thanks very much for the code. it hasn't gone to waste! |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is necessary because uWSGI has many flags, which exceed the scope of
this cookbook. Instead of supporting every single possible flag with logic,
support any possibility with attributes, override attributes, and the like.
One single hash contains all the information for the uWSGI configuration file.
Example:
The key is rendered as '--flag' and the value is rendered as 'val'
EG: default['graphite']['uwsgi']['config']['key'] = 'val'
--key val
Integers are cast to strings
Arrays repeat the flag name, such as
default['graphite']['uwsgi']['config']['pythonpath'] = [foo, bar]
--pythonpath foo
--pythonpath bar
If a value is set to Boolean type true, the flag is simply stated
EG: default['graphite']['uwsgi']['config']['master'] = true
--master