From 9ee067a7568982c5fc53c238b2b968af041f9e14 Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Tue, 22 Aug 2023 18:50:55 +0200 Subject: [PATCH] Change default ulimits --- coreos-config/plays/common.yaml | 27 +++++++++++++++++++++++++++ coreos-config/plays/vps.yaml | 19 ------------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/coreos-config/plays/common.yaml b/coreos-config/plays/common.yaml index aecb84b..e73a68e 100644 --- a/coreos-config/plays/common.yaml +++ b/coreos-config/plays/common.yaml @@ -159,3 +159,30 @@ enabled: true masked: false daemon_reload: true +- name: Setup Docker Config + hosts: all + become: true + become_user: root + tasks: + - name: Template Config + ansible.builtin.template: + src: "docker-daemon.json.j2" + dest: /etc/docker/daemon.json + owner: root + group: root + mode: '0600' + notify: Restart Docker + - name: Setup default ulimts + ansible.builtin.lineinfile: + path: /etc/sysconfig/docker + search_string: '--default-ulimit nofile=' + line: ' --default-ulimit nofile=4096:4096 \' + notify: Restart Docker + - name: Restart Docker if necessary + meta: flush_handlers + handlers: + - name: Restart Docker + ansible.builtin.systemd: + state: restarted + name: docker.service + diff --git a/coreos-config/plays/vps.yaml b/coreos-config/plays/vps.yaml index 93045e8..b3dfaa0 100644 --- a/coreos-config/plays/vps.yaml +++ b/coreos-config/plays/vps.yaml @@ -1,22 +1,3 @@ -- name: Setup Docker Config - hosts: host.nc.chaoswg.org - become: true - become_user: root - tasks: - - name: Template Config - ansible.builtin.template: - src: "docker-daemon.json.j2" - dest: /etc/docker/daemon.json - owner: root - group: root - mode: '0600' - register: docker_config - - name: Restart Docker - ansible.builtin.systemd: - state: restarted - name: docker.service - when: docker_config.changed - - name: Setup VPS hosts: host.nc.chaoswg.org vars: