ansible/MY/docker_net.yaml

25 lines
670 B
YAML
Raw Normal View History

2025-10-31 08:47:26 +04:00
---
2026-05-22 06:43:27 +04:00
- hosts: hip
2025-10-31 08:47:26 +04:00
#become: yes
tasks:
2026-05-22 06:43:27 +04:00
- name: Install Docker SDK for Python via apt
ansible.builtin.apt:
name: python3-docker
state: present
become: yes
2025-10-31 08:47:26 +04:00
- name: Create a network with custom IPAM config
community.docker.docker_network:
name: overlay_net
driver_options:
com.docker.network.bridge.name: overlay_net
ipam_config:
- subnet: "{{ docker_overlay_net_subnet }}"
gateway: "{{ docker_overlay_net_gateway }}"
iprange: "{{ docker_overlay_net_iprange }}"
#aux_addresses:
# host1: 172.23.27.3
#host2: 172.23.27.4