From 08ccfc5641089a9dfbfd74b66eea140bfe2d2b99 Mon Sep 17 00:00:00 2001 From: Tony Crowe Date: Mon, 4 Nov 2019 15:00:34 -0700 Subject: [PATCH] download mime.types file if it's missing (#241) --- tasks/configuration.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tasks/configuration.yml b/tasks/configuration.yml index e810114..129564b 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -1,4 +1,20 @@ --- + +- name: Check if nginx mime.types file exists + stat: + path: "{{ nginx_conf_dir }}/mime.types" + register: nginx_mime_types_file + notify: + - reload nginx + +- name: Ensure mime.types file exists if it was missing + get_url: + url: https://raw.githubusercontent.com/nginx/nginx/master/conf/mime.types + dest: "{{ nginx_conf_dir }}/mime.types" + when: nginx_mime_types_file.stat.exists == False + notify: + - reload nginx + - name: Copy the nginx configuration file template: src: nginx.conf.j2 @@ -121,5 +137,4 @@ when: (item not in nginx_remove_modules) and (item not in nginx_disabled_modules) ignore_errors: "{{ ansible_check_mode }}" notify: - - reload nginx - + - reload nginx \ No newline at end of file