ansible/roles/web/tasks/main.yml

35 lines
919 B
YAML

---
- name: Create website directories
file:
path: "{{ websites_basepath }}/{{ item.name }}"
state: directory
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0755
with_items: "{{ websites_to_up }}"
- name: Copy nginx configurations
template:
src: "nginx.conf.j2"
dest: "{{ websites_basepath }}/{{ item.name }}.conf"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
with_items: "{{ websites_to_up }}"
- name: Create Docker Compose from websites definition
template:
src: "docker-compose.yml.j2"
dest: "{{ websites_basepath }}/docker-compose.yml"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
- name: Create websites containers
community.docker.docker_compose:
project_src: "{{ websites_basepath }}"
remove_orphans: yes
pull: yes
recreate: smart
state: present