ansible/roles/ingress/tasks/main.yml

23 lines
939 B
YAML

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: assure ingress container persist directories
file: path="{{ ingress_container_persist_dir }}/{{ item }}" state=directory owner=root mode=0755
with_items:
- letsencrypt
- user_conf.d
- name: template out ingress configuration file
template: src=vhosts.conf.j2 dest="{{ ingress_container_persist_dir }}/user_conf.d/vhosts.conf" mode="0640"
notify: restart ingress container
- name: assure ingress container
docker_container:
name: ingress
image: "{{ ingress_container_image }}"
env:
TZ: "{{ ingress_container_timezone }}"
CERTBOT_EMAIL: "{{ ingress_container_certbot_email }}"
networks: "{{ ingress_container_networks }}"
ports: "{{ ingress_container_ports }}"
volumes:
- "{{ ingress_container_persist_dir }}/letsencrypt:/etc/letsencrypt"
- "{{ ingress_container_persist_dir }}/user_conf.d:/etc/nginx/user_conf.d:ro"