saltstack-formulas / nginx-formula

Nginx Salt Formula
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
163 stars 421 forks source link

feat(streams): add support for nginx streams #292

Open MemoryLeak55 opened 2 years ago

MemoryLeak55 commented 2 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

N/A

Describe the changes you're proposing

Currently the formula does not have support for streams (TCP and UDP loadbalancing), and putting it in the nginx.conf file doesn't work due to key conflicts (the server key is used for the main config, but also used by streams). Either way, I couldn't get it right and it seems a bit cleaner in my opinion to have streams working like snippets instead of putting everything in the main config.

see https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/

Pillar / config required to test the proposed changes

I exactly copied and pasted the snippets functionality and changed it to streams, and added some defaults to the map file. I don't know how to test it, but am willing to learn. It's working for my use case so far, for what it's worth

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

I've tried squashing the PR into a single commit that conforms to the commit message guidelines with little success. As per the title the squash message should be

feat(streams): add support for nginx streams