From 6a23c42a7e513d134bc23bb76e0218e1bc0553e3 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 14 Apr 2020 11:35:45 +0200 Subject: [PATCH] Allow to pass nginx.d files --- plays/postdeploy/lib/nginxd.yml | 24 ++++++++++++++++++++++++ plays/postdeploy/postdeploy.yml | 1 + 2 files changed, 25 insertions(+) create mode 100644 plays/postdeploy/lib/nginxd.yml diff --git a/plays/postdeploy/lib/nginxd.yml b/plays/postdeploy/lib/nginxd.yml new file mode 100644 index 0000000..d53ab5a --- /dev/null +++ b/plays/postdeploy/lib/nginxd.yml @@ -0,0 +1,24 @@ +--- +- name: Create nginx customisation directory + become: true + file: + path: "/home/dokku/{{ app }}/nginx.conf.d/" + state: directory + owner: dokku + group: dokku + +- name: Copy over the nginx custom configuration + become: true + template: + src: "{{ item }}" + dest: "/home/dokku/{{ app }}/nginx.conf.d/{{ item }}" + owner: dokku + group: dokku + with_fileglob: + - "{{ app_config_root }}/nginx.d/*.conf" + +- name: Reload nginx to enable custom configurations + become: true + service: + name: nginx + state: reloaded diff --git a/plays/postdeploy/postdeploy.yml b/plays/postdeploy/postdeploy.yml index 16b3dc5..330690a 100644 --- a/plays/postdeploy/postdeploy.yml +++ b/plays/postdeploy/postdeploy.yml @@ -6,3 +6,4 @@ - include: ./lib/http.yml - include: ./lib/https.yml - include: ./lib/proxy.yml + - include: ./lib/nginxd.yml