This repository has been archived on 2020-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-deploy/plays/postdeploy/lib/nginxd.yml
2020-04-14 13:02:16 +02:00

33 lines
800 B
YAML

---
- name: Check if a custom nginx directory exists
stat:
path: "{{ app_config_root }}/nginx.d/"
register: custom_nginx_d
- name: Create nginx customisation directory
become: true
file:
path: "/home/dokku/{{ dokku.app }}/nginx.conf.d/"
state: directory
owner: dokku
group: dokku
when: custom_nginx_d.stat.exists
- name: Copy over the nginx custom configuration
become: true
template:
src: "{{ item }}"
dest: "/home/dokku/{{ dokku.app }}/nginx.conf.d/{{ item | basename }}"
owner: dokku
group: dokku
with_fileglob:
- "{{ app_config_root }}/nginx.d/*.conf"
when: custom_nginx_d.stat.exists
- name: Reload nginx to enable custom configurations
become: true
service:
name: nginx
state: reloaded
when: custom_nginx_d.stat.exists