Skip to content

Commit

Permalink
Docker network range fixed on dockerservice
Browse files Browse the repository at this point in the history
  • Loading branch information
cradle8810 committed Oct 30, 2024
1 parent f0b29d0 commit 6073368
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dockerservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
become: true

vars_files:
- inventories/host_vars/docker_service.yml
- inventories/host_vars/dockerservice.yml
- inventories/host_vars/networks.yml

handlers:
Expand Down Expand Up @@ -34,6 +34,15 @@
docker_users:
- hayato

- name: Put Docker config
ansible.builtin.template:
src: templates/dockerservice/etc/docker/daemon.json.j2
dest: /etc/docker/daemon.json
owner: root
group: root
mode: '0644'
notify: "Restart docker"

- name: Mount skylark
ansible.builtin.import_tasks:
file: tasks/dockerservice/mount_docker.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ services_start:
dockerdir:
UUID: "6db90b73-6dbd-4c00-9b13-724f0cb4e636"

docker_network:
base: "172.18.0.0/12"
size: "24"

firewall:
policy: deny
allow_rules:
Expand Down
8 changes: 8 additions & 0 deletions templates/dockerservice/etc/docker/daemon.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"default-address-pools" : [
{
"base" : "{{ docker_network.base }}",
"size" : {{ docker_network.size }}
}
]
}

0 comments on commit 6073368

Please sign in to comment.