This repository has been archived on 2024-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
cpx-ansible/roles/docker_services/tasks/config.yml
2023-04-21 00:28:07 +02:00

46 lines
1.1 KiB
YAML

# vim: ft=yaml.ansible
---
- name: Create base directory for Docker volumes
ansible.builtin.file:
path: "{{ base_volume }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Copy Docker daemon config file
ansible.builtin.copy:
src: dockerd/daemon.json
dest: /etc/docker/daemon.json
owner: root
mode: u=rw,g=r,o=r
register: daemon_config
- name: (Re)start Docker daemon
ansible.builtin.service:
name: "{{ item }}"
enabled: true
state: "{{ 'restarted' if daemon_config.changed else 'started' }}"
loop:
- docker.socket
- docker.service
- 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 Tor
community.docker.docker_network:
name: tor
state: present
- name: Copy nginx.conf to shared location
ansible.builtin.copy:
src: shared/nginx.conf
dest: "{{ base_volume }}/nginx.conf"
owner: root
mode: u=rw,g=r,o=r