lab-ansible/roles/docker_services/tasks/services.yml
2023-10-29 01:00:05 +02:00

31 lines
798 B
YAML

# vim: ft=yaml.ansible
---
- name: Create Docker network for services
community.docker.docker_network:
name: services
enable_ipv6: true
ipam_config:
- subnet: 172.16.0.0/16
- subnet: fd02::/64
state: present
- name: Create base directories for Docker volumes
ansible.builtin.file:
name: "{{ item }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
loop:
- "{{ base_volume }}"
- "{{ mass_data_volume }}"
- name: Deploy services
ansible.builtin.include_tasks: services/{{ item.key }}.yml
loop: "{{ services | dict2items }}"
when: single_service is not defined
- name: Deploy single service
ansible.builtin.include_tasks: services/{{ single_service }}.yml
when: single_service is defined and
single_service in services