Move docker config to docker-config.json

This commit is contained in:
Tobias Manske 2024-01-22 14:47:35 +01:00
parent fbbb4888dd
commit 1a3055bc8a
Signed by: tobias
GPG Key ID: 9164B527694A0709
2 changed files with 20 additions and 2 deletions

View File

@ -202,6 +202,11 @@
become: true become: true
become_user: root become_user: root
tasks: tasks:
- ansible.builtin.file:
path: /etc/docker
owner: root
state: directory
mode: '0700'
- name: Template Config - name: Template Config
ansible.builtin.template: ansible.builtin.template:
src: "docker-daemon.json.j2" src: "docker-daemon.json.j2"
@ -210,17 +215,23 @@
group: root group: root
mode: '0600' mode: '0600'
notify: Restart Docker notify: Restart Docker
- name: Setup default ulimts - name: Check if sysconfig exists
ansible.builtin.stat:
path: /etc/sysconfig/docker
register: sysconfig
- name: Remove ulimits from sysconfig
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/sysconfig/docker path: /etc/sysconfig/docker
search_string: '--default-ulimit nofile=' search_string: '--default-ulimit nofile='
line: ' --default-ulimit nofile=4096:4096 \' state: absent
when: sysconfig.stat.exists
notify: Restart Docker notify: Restart Docker
- name: Remove log-driver from sysconfig - name: Remove log-driver from sysconfig
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/sysconfig/docker path: /etc/sysconfig/docker
search_string: '--log-driver=' search_string: '--log-driver='
state: absent state: absent
when: sysconfig.stat.exists
notify: Restart Docker notify: Restart Docker
- name: Restart Docker if necessary - name: Restart Docker if necessary
meta: flush_handlers meta: flush_handlers

View File

@ -10,6 +10,13 @@
{ "base":"10.254.0.0/17","size":26 }, { "base":"10.254.0.0/17","size":26 },
{ "base": "fd64:2::/104", "size": 112 } { "base": "fd64:2::/104", "size": 112 }
], ],
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Hard": 65535,
"Soft": 65535
}
},
"experimental": true, "experimental": true,
"ipv6": true, "ipv6": true,
"fixed-cidr-v6": "fd64:1::/64", "fixed-cidr-v6": "fd64:1::/64",