diff options
author | Peter Mikus <pmikus@cisco.com> | 2022-07-07 10:31:16 +0000 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2022-07-07 13:11:37 +0000 |
commit | 2720dc186a1e488833533bfa8e14bfaa578aabca (patch) | |
tree | 18f2f75ab8409c20ac500c657fad64168cff5914 /fdio.infra.ansible/roles/docker/tasks/main.yaml | |
parent | 9f603617b10a447c59cd17110a89f67a1bf42d6e (diff) |
feat(ansible): Migrate Ubuntu Jammy II
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I43c86ab3232a382e7cc9010fb04a0ca269b24e77
Diffstat (limited to 'fdio.infra.ansible/roles/docker/tasks/main.yaml')
-rw-r--r-- | fdio.infra.ansible/roles/docker/tasks/main.yaml | 39 |
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 |