Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
download mime.types file if it's missing (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrowe authored and jdauphant committed Nov 4, 2019
1 parent c969677 commit 08ccfc5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tasks/configuration.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit 08ccfc5

Please sign in to comment.