30 lines
746 B
YAML
30 lines
746 B
YAML
- name: "Launch the site's containers"
|
|
docker_compose:
|
|
project_src: "{{ sites_path }}/{{ item.slug }}"
|
|
state: present
|
|
build: yes
|
|
restarted: yes
|
|
tags: docker
|
|
|
|
- name: Copy host config to /etc/nginx/sites-available
|
|
copy:
|
|
remote_src: yes
|
|
src: "{{ sites_path }}/{{ item.slug }}/nginx.host"
|
|
dest: "/etc/nginx/sites-available/{{ item.url }}"
|
|
become: yes
|
|
notify: Restart nginx
|
|
tags: nginx
|
|
|
|
- name: "Symlink nginx configuration to sites-enabled"
|
|
file:
|
|
src: "/etc/nginx/sites-available/{{ item.url }}"
|
|
dest: "/etc/nginx/sites-enabled/{{ item.url }}"
|
|
state: link
|
|
become: yes
|
|
notify: Restart nginx
|
|
tags: nginx
|
|
|
|
- name: Verify nginx configuration
|
|
command: "nginx -t"
|
|
become: yes
|
|
tags: nginx
|