-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_deploy.yml
40 lines (35 loc) · 1.07 KB
/
docker_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- hosts: all
become: true
gather_facts: true
tasks:
- name: "Include credentials"
ansible.builtin.include_vars: ./vars/.credentials.yml
- name: "Create proxy_default network"
community.docker.docker_network:
name: proxy_default
attachable: true
appends: true
- name: "Deploy br0 network"
community.docker.docker_network:
name: br0
driver: "ipvlan"
attachable: false
appends: true
scope: local
driver_options:
parent: "{{ shim_parent_interface }}"
ipam_driver_options: {}
ipam_config:
- gateway: 172.16.0.1
subnet: 172.16.0.0/24
aux_addresses:
server: 172.16.0.13
- name: "Create compose projects"
community.docker.docker_compose_v2:
project_name: "{{ item }}"
definition: "{{ lookup('ansible.builtin.template', 'compose/' + item + '.yml') | from_yaml }}"
state: present
loop: "{{ projects | flatten(levels=1) }}"
loop_control:
index_var: i