This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/docker_services/tasks/services.yml

35 lines
931 B
YAML

# vim: ft=yaml.ansible
---
- name: Create Docker network for services
community.docker.docker_network:
name: services
ipam_config:
- subnet: 172.16.0.0/16
gateway: 172.16.0.1
state: present
- name: Create Docker network for Pi-hole and WireGuard
community.docker.docker_network:
name: pihole_wireguard
ipam_config:
- subnet: 172.18.0.0/16
gateway: 172.18.0.1
state: present
- name: Create base directory for Docker volumes
ansible.builtin.file:
name: "{{ base_volume }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- 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