44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
---
|
|
- name: ensure conf.d directory exists
|
|
ansible.builtin.file:
|
|
path: "/var/lib/hubdmz/conf.d/"
|
|
state: directory
|
|
|
|
- name: configure nginx with stream module
|
|
template:
|
|
src: nginx.conf.j2
|
|
dest: "/var/lib/hubdmz/conf.d/stream.conf"
|
|
mode: 0644
|
|
notify: reload nginx
|
|
|
|
- name: ensure http.d directory exists
|
|
ansible.builtin.file:
|
|
path: "/var/lib/hubdmz/http.d/"
|
|
state: directory
|
|
|
|
- name: configure nginx with a default host
|
|
template:
|
|
src: http.conf.j2
|
|
dest: "/var/lib/hubdmz/http.d/00-default.conf"
|
|
mode: 0644
|
|
notify: reload nginx
|
|
|
|
- name: launch hubdmz container
|
|
docker_container:
|
|
name: "hubdmz"
|
|
image: "registry.nemunai.re/hubdmz:{{ version }}"
|
|
pull: true
|
|
volumes:
|
|
- "/var/lib/hubdmz/conf.d/:/etc/nginx/conf.d/"
|
|
- "/var/lib/hubdmz/http.d/:/etc/nginx/http.d/"
|
|
state: "started"
|
|
memory: 512M
|
|
published_ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
log_driver: syslog
|
|
log_options:
|
|
syslog-address: unixgram:///dev/log
|
|
syslog-facility: daemon
|
|
tag: "hubdmz"
|