Skip to content

Commit 490a7f3

Browse files
committed
Update README with stream example
1 parent 5d934fd commit 490a7f3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,48 @@ Create the child template in the path you configured above and extend `geerlingg
231231
{% endblock %}
232232
```
233233
234+
### Example: LDAP stream via Nginx
235+
236+
This example describes how to setup a secure LDAP stream via Nginx.
237+
238+
Create the following file in your playbook directory (e.g. `templates/nginx/vhost-stream.j2`):
239+
240+
```
241+
stream {
242+
server {
243+
listen {{ item.listen }};
244+
245+
{% if item.server_name is defined and item.server_name|length > 0 %}
246+
server_name {{ item.server_name }};
247+
{% endif %}
248+
249+
{% if item.vhost_parameters is defined %}
250+
{{ item.vhost_parameters|indent(8) }}
251+
{% endif %}
252+
253+
}
254+
}
255+
```
256+
257+
Then, in your Ansible vars, specify e.g. the following configuration:
258+
259+
```yaml
260+
nginx_vhosts:
261+
# Configuration for other hosts
262+
# <snip>
263+
264+
# LDAPS
265+
- listen: "636 ssl"
266+
server_name: "ldap.example.com"
267+
template: "{{ playbook_dir }}/templates/nginx/vhost-stream.j2"
268+
filename: "ldap.example.com.636.stream"
269+
vhost_parameters: |
270+
ssl_certificate /etc/letsencrypt/live/ldap.example.com/fullchain.pem;
271+
ssl_certificate_key /etc/letsencrypt/live/ldap.example.com/privkey.pem;
272+
273+
proxy_pass ldap-vm1.internal:389;
274+
```
275+
234276
## Dependencies
235277

236278
None.

0 commit comments

Comments
 (0)