summaryrefslogtreecommitdiff
path: root/roles/nginx/base/tasks/stream.yml
blob: 2fddbddb923300a7c003f5303ff4a65cc45fa700 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- name: install nginx stream module
  apt:
    name: libnginx-mod-stream

- name: create directories for stream config files
  loop:
    - available
    - enabled
  file:
    path: "/etc/nginx/streams-{{ item }}"
    state: directory

- name: add stream config section
  blockinfile:
    path: /etc/nginx/nginx.conf
    block: |
      stream {
      	include /etc/nginx/streams-enabled/*;
      }
    marker: "# streams: {mark} ansible managed block"
  notify: restart nginx