diff --git a/README.md b/README.md index d421aa6..5e70115 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,17 @@ server { } ``` +Alternatively, you can define `uwsgi_graphite_extraopts` with additional uwsgi configuration, which can e.g. enable http on port 8080 or add basic auth: +```yaml +uwsgi_graphite_extraopts: + - option: http + value: "{{ ansible_default_ipv4.address }}:8080" + - option: plugins + value: router_basicauth + - option: route + value: "^/ basicauth:myRealm,foo:bar" +``` + Role Variables -------------- diff --git a/defaults/main.yml b/defaults/main.yml index f58ebf9..0e0421c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -96,3 +96,6 @@ graphite_aggregator_use_flow_control: true graphite_aggregator_use_whitelist: false #graphite_aggregator_user: graphite_aggregator_write_back_frequency: 0 + +# Optional extra options for uwsgi_graphite.ini +uwsgi_graphite_extraopts: [] diff --git a/templates/uwsgi_graphite.ini.j2 b/templates/uwsgi_graphite.ini.j2 index b91e932..fae8883 100644 --- a/templates/uwsgi_graphite.ini.j2 +++ b/templates/uwsgi_graphite.ini.j2 @@ -8,3 +8,6 @@ module = wsgi:application {% if ansible_os_family == "RedHat" %} pidfile = /run/uwsgi/graphite/pid {% endif %} +{% for opts in uwsgi_graphite_extraopts %} +{{ opts.option }}={{ opts.value }} +{% endfor %}