Skip to content

Instantly share code, notes, and snippets.

@tadeboro
Created September 11, 2020 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadeboro/fb824e641aa94761bb8f460f8bbd46e8 to your computer and use it in GitHub Desktop.
Save tadeboro/fb824e641aa94761bb8f460f8bbd46e8 to your computer and use it in GitHub Desktop.
Templatng NGINX config
server {
{% for location in nginx_extra_basic_location_options %}
{{ location }};
{% endfor %}
}
---
- hosts: localhost
gather_facts: false
vars:
nginx_extra_basic_location_options:
- include conf.d/whitelists/internal.conf
- deny all
tasks:
- name: Template the config
template:
src: input.j2
dest: /tmp/output.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment