aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/docker/tasks/main.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/docker/tasks/main.yaml')
-rw-r--r--fdio.infra.ansible/roles/docker/tasks/main.yaml39
1 files changed, 20 insertions, 19 deletions
diff --git a/fdio.infra.ansible/roles/docker/tasks/main.yaml b/fdio.infra.ansible/roles/docker/tasks/main.yaml
index 27b9d250da..e07b29e363 100644
--- a/fdio.infra.ansible/roles/docker/tasks/main.yaml
+++ b/fdio.infra.ansible/roles/docker/tasks/main.yaml
@@ -1,12 +1,12 @@
---
# file: roles/docker/tasks/main.yaml
-- include_tasks: "{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml"
+- include_tasks: "{{ ansible_distribution_release }}.yaml"
tags:
- docker-inst-dependencies
- name: Inst - Docker
- package:
+ ansible.builtin.package:
name:
- "{{ docker_package }}"
- "{{ docker_package }}-cli"
@@ -15,22 +15,27 @@
- docker-inst-package
- name: Conf - Docker Service
- service:
+ ansible.builtin.service:
name: docker
state: "{{ docker_service_state }}"
enabled: "{{ docker_service_enabled }}"
+ when:
+ - docker_service_mgr == "systemd"
tags:
- docker-conf-service
- name: Conf - Docker Service Directory
- file:
+ ansible.builtin.file:
path: "/etc/systemd/system/docker.service.d"
state: "directory"
+ mode: "0755"
+ when:
+ - docker_service_mgr == "systemd"
tags:
- docker-conf-service
- name: Conf - Docker Daemon
- template:
+ ansible.builtin.template:
src: "templates/daemon.json.j2"
dest: "/etc/docker/daemon.json"
owner: "root"
@@ -39,12 +44,13 @@
notify:
- "Restart Docker"
when: >
- docker_daemon is defined
+ docker_daemon is defined and
+ docker_service_mgr == "systemd"
tags:
- docker-conf-daemon
- name: Conf - Docker HTTP Proxy
- template:
+ ansible.builtin.template:
src: "templates/docker.service.proxy.http"
dest: "/etc/systemd/system/docker.service.d/http-proxy.conf"
owner: "root"
@@ -54,12 +60,13 @@
- "Restart Docker"
when: >
proxy_env is defined and
- proxy_env.http_proxy is defined
+ proxy_env.http_proxy is defined and
+ docker_service_mgr == "systemd"
tags:
- docker-conf-service
- name: Conf - Docker HTTPS Proxy
- template:
+ ansible.builtin.template:
src: "templates/docker.service.proxy.https"
dest: "/etc/systemd/system/docker.service.d/https-proxy.conf"
owner: "root"
@@ -69,16 +76,10 @@
- "Restart Docker"
when: >
proxy_env is defined and
- proxy_env.https_proxy is defined
+ proxy_env.https_proxy is defined and
+ docker_service_mgr == "systemd"
tags:
- docker-conf-service
-- name: Conf - Users to Docker Group
- user:
- name: "{{ ansible_user }}"
- groups: "docker"
- append: true
- tags:
- - docker-conf-user
-
-- meta: flush_handlers
+- name: Meta - Flush handlers
+ ansible.builtin.meta: flush_handlers