23 lines
644 B
YAML
23 lines
644 B
YAML
# 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
|
|
notify: Restart nginx
|
|
|
|
- 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
|