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

Add task to remove default.conf from sites-enabled/ #231

Merged
merged 2 commits into from
Oct 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tasks/remove-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
notify:
- reload nginx

- name: Disable the default site (on newer nginx versions)
file:
path: "{{nginx_conf_dir}}/sites-enabled/default.conf"
state: absent
notify:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a problem if someone setup default in nginx_sites.
You can use something like that:

when: >
     'default' not in nginx_sites.keys()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, do you think that's ok?

- reload nginx
when: >
'default' not in nginx_sites.keys()

- name: Remove the default configuration
file:
path: "{{nginx_conf_dir}}/conf.d/default.conf"
Expand Down