automation/deployer/roles/deploy/tasks/nginx.yml

24 lines
644 B
YAML
Raw Normal View History

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
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