-
Notifications
You must be signed in to change notification settings - Fork 417
feat(streams): add support for nginx streams #292
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
base: master
Are you sure you want to change the base?
Changes from all commits
e690655
96945ca
536992a
3df82ac
0ffb457
3b727d0
afc61f6
631c94d
bf0c0b5
9d62fc6
1c1eea0
26d895f
bd7275a
e740cd2
65ff638
43b1163
3177e2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# nginx.streams | ||
# | ||
# Manages creation of streams | ||
|
||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %} | ||
{%- from tplroot ~ '/libtofs.jinja' import files_switch with context %} | ||
|
||
{#- _nginx is a lightened copy of nginx map intended to passed in templates #} | ||
{%- set _nginx = nginx.copy() %} | ||
|
||
{%- do _nginx.pop('streams') if nginx.snippets is defined %} | ||
{%- do _nginx.pop('servers') if nginx.servers is defined %} | ||
|
||
|
||
nginx_streams_dir: | ||
file.directory: | ||
{{ sls_block(nginx.servers.dir_opts) }} | ||
- name: {{ nginx.lookup.streams_dir }} | ||
|
||
{% for stream, config in nginx.streams.items() %} | ||
nginx_streams_{{ stream }}: | ||
file.managed: | ||
- name: {{ nginx.lookup.streams_dir ~ '/' ~ stream }} | ||
- source: {{ files_switch([ stream, 'server.conf' ], | ||
'nginx_stream_file_managed' | ||
) | ||
}} | ||
- template: jinja | ||
- context: | ||
config: {{ config|json() }} | ||
nginx: {{ _nginx|json() }} | ||
{% endfor %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,7 +109,16 @@ nginx: | |
- upstream netdata: | ||
- server: 127.0.0.1:19999 | ||
- keepalive: 64 | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are whitespaces after the closing bracket, that tests are showing. Can you remove them? |
||
streams: | ||
example_stream: | ||
- upstream some_upstream: | ||
- server: '10.0.0.1:8000' | ||
- server: '10.0.0.2:8000' | ||
- server: | ||
- listen: 7000 | ||
- proxy_pass: some_upstream | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are whitespaces after the closing bracket, that tests are showing. Can you remove them? |
||
server: | ||
# this partially exposes file.managed parameters as they relate to the main | ||
# nginx.conf file | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a whitespace after the closing bracket, that tests are showing. Can you remove it?