- name: check for minimum kernel version fail: msg: > docker requires a minimum kernel version of { { docker_kernel_min_version } } on { { ansible_distribution } }-{ { ansible_distribution_version } } when: (not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]) and (ansible_kernel|version_compare(docker_kernel_min_version, "<")) tags: facts
- name: check minimum docker version for docker_dns mode. You need at least docker version >= 1.12 for resolvconf_mode=docker_dns command: "docker version -f '{ { '{ {' } }.Client.Version{ { '} }' } }'" register: docker_version failed_when: docker_version.stdout|version_compare('1.12', '<') changed_when: false when: dns_mode != 'none' and resolvconf_mode == 'docker_dns'
# kargo 对 docker service 的配置会在此写入,我感觉还不错,所以留着了;但是注意的是它会把原来的覆盖掉
- name: Set docker systemd config include: systemd.yml
- name: ensure docker service is started and enabled service: name: "{ { item } }" enabled: yes state: started with_items: - docker
kargo 在进行各种任务(task)时可能会释放一些配置文件,比如 docker service 配置文件、kubernetes 配置文件等;这些文件一般位于 roles/组件/templates 目录,比如 docker 的 service 配置位于如下位置;我们可以更改,甚至直接换一个,把里面写死变成我们自己的