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

33 lines
800 B
YAML
Raw Normal View History

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