2020-05-07 06:17:17 +00:00
|
|
|
# Needs variables:
|
|
|
|
# - site: dict describing the site install (cf group_vars/all/vars.yml)
|
|
|
|
|
|
|
|
- name: Copy host config to /etc/nginx/sites-available
|
|
|
|
copy:
|
|
|
|
remote_src: yes
|
|
|
|
src: "{{ sites_path }}/{{ site.slug }}/nginx.host"
|
|
|
|
dest: "/etc/nginx/sites-available/{{ site.url }}"
|
|
|
|
become: yes
|
2021-01-29 09:54:45 +00:00
|
|
|
notify: Restart nginx
|
2020-05-07 06:17:17 +00:00
|
|
|
|
|
|
|
- name: "Symlink nginx configuration to sites-enabled"
|
|
|
|
file:
|
|
|
|
src: "/etc/nginx/sites-available/{{ site.url }}"
|
|
|
|
dest: "/etc/nginx/sites-enabled/{{ site.url }}"
|
|
|
|
state: link
|
|
|
|
become: yes
|
|
|
|
notify: Restart nginx
|
|
|
|
|
|
|
|
- name: Verify nginx configuration
|
|
|
|
command: "nginx -t"
|
|
|
|
any_errors_fatal: true
|
|
|
|
become: yes
|