Skip to content

Allow uWSGI configuration entirely through attributes#233

Closed
sethdmoore wants to merge 2 commits into
sous-chefs:developfrom
brandingbrand:uwsgi-config-through-attributes-develop
Closed

Allow uWSGI configuration entirely through attributes#233
sethdmoore wants to merge 2 commits into
sous-chefs:developfrom
brandingbrand:uwsgi-config-through-attributes-develop

Conversation

@sethdmoore

Copy link
Copy Markdown

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
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
@damacus

damacus commented Apr 30, 2017

Copy link
Copy Markdown
Member

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!

@damacus damacus closed this Apr 30, 2017
@damacus damacus mentioned this pull request Apr 30, 2017
10 tasks
@lock

lock Bot commented Apr 25, 2020

Copy link
Copy Markdown

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants