mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2025-08-02 13:46:22 +02:00
Added capabilty to configure docker/containerd root path
This commit is contained in:
parent
e5adc9a528
commit
d5e959d15c
@ -29,3 +29,9 @@ docker_yum_gpg_key: https://download.docker.com/linux/centos/gpg
|
|||||||
|
|
||||||
# A list of users who will be added to the docker group.
|
# A list of users who will be added to the docker group.
|
||||||
docker_users: []
|
docker_users: []
|
||||||
|
|
||||||
|
# configuration
|
||||||
|
docker_default_config: true
|
||||||
|
docker_root_path: ""
|
||||||
|
containerd_root_path: ""
|
||||||
|
docker_native_cgroup: ""
|
||||||
|
@ -25,3 +25,19 @@
|
|||||||
|
|
||||||
- include_tasks: docker-users.yml
|
- include_tasks: docker-users.yml
|
||||||
when: docker_users | length > 0
|
when: docker_users | length > 0
|
||||||
|
|
||||||
|
- name: Configure docker
|
||||||
|
template:
|
||||||
|
src: daemon.json.j2
|
||||||
|
dest: /etc/docker/daemon.json
|
||||||
|
mode: 0666
|
||||||
|
notify: restart docker
|
||||||
|
when: not docker_default_config
|
||||||
|
|
||||||
|
- name: Configure containerd
|
||||||
|
template:
|
||||||
|
src: config.toml.j2
|
||||||
|
dest: /etc/containerd/config.toml
|
||||||
|
mode: 0666
|
||||||
|
notify: restart docker
|
||||||
|
when: not docker_default_config
|
||||||
|
31
templates/config.toml.j2
Normal file
31
templates/config.toml.j2
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Copyright 2018-2020 Docker Inc.
|
||||||
|
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
disabled_plugins = ["cri"]
|
||||||
|
|
||||||
|
root = "{{ containerd_root_path }}"
|
||||||
|
#state = "/run/containerd"
|
||||||
|
#subreaper = true
|
||||||
|
#oom_score = 0
|
||||||
|
|
||||||
|
#[grpc]
|
||||||
|
# address = "/run/containerd/containerd.sock"
|
||||||
|
# uid = 0
|
||||||
|
# gid = 0
|
||||||
|
|
||||||
|
#[debug]
|
||||||
|
# address = "/run/containerd/debug.sock"
|
||||||
|
# uid = 0
|
||||||
|
# gid = 0
|
||||||
|
# level = "info"
|
4
templates/daemon.json.j2
Normal file
4
templates/daemon.json.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"data-root": "{{docker_root_path}}",
|
||||||
|
"exec-opts": ["native.cgroupdriver={{docker_native_cgroup}}"]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user