diff options
Diffstat (limited to 'fdio.infra.ansible/roles/docker/tasks')
-rw-r--r-- | fdio.infra.ansible/roles/docker/tasks/focal.yaml (renamed from fdio.infra.ansible/roles/docker/tasks/ubuntu_focal.yaml) | 6 | ||||
-rw-r--r-- | fdio.infra.ansible/roles/docker/tasks/jammy.yaml (renamed from fdio.infra.ansible/roles/docker/tasks/ubuntu_jammy.yaml) | 6 | ||||
-rw-r--r-- | fdio.infra.ansible/roles/docker/tasks/main.yaml | 39 |
3 files changed, 26 insertions, 25 deletions
diff --git a/fdio.infra.ansible/roles/docker/tasks/ubuntu_focal.yaml b/fdio.infra.ansible/roles/docker/tasks/focal.yaml index 236cec6322..27fee6285c 100644 --- a/fdio.infra.ansible/roles/docker/tasks/ubuntu_focal.yaml +++ b/fdio.infra.ansible/roles/docker/tasks/focal.yaml @@ -2,7 +2,7 @@ # file: roles/docker/tasks/ubuntu_focal.yaml - name: Inst - Dependencies - apt: + ansible.builtin.apt: name: - "apt-transport-https" - "ca-certificates" @@ -15,14 +15,14 @@ - docker-inst-dependencies - name: Conf - Add APT Key - apt_key: + ansible.builtin.apt_key: url: "{{ docker_apt_gpg_key }}" state: "{{ docker_apt_gpg_key_state }}" tags: - docker-conf-apt - name: Conf - Install APT Repository - apt_repository: + ansible.builtin.apt_repository: repo: "{{ docker_apt_repository }}" state: "{{ docker_apt_repository_state }}" update_cache: true diff --git a/fdio.infra.ansible/roles/docker/tasks/ubuntu_jammy.yaml b/fdio.infra.ansible/roles/docker/tasks/jammy.yaml index 51f60ee348..8ec7a01ee1 100644 --- a/fdio.infra.ansible/roles/docker/tasks/ubuntu_jammy.yaml +++ b/fdio.infra.ansible/roles/docker/tasks/jammy.yaml @@ -2,7 +2,7 @@ # file: roles/docker/tasks/ubuntu_jammy.yaml - name: Inst - Dependencies - apt: + ansible.builtin.apt: name: - "apt-transport-https" - "ca-certificates" @@ -15,14 +15,14 @@ - docker-inst-dependencies - name: Conf - Add APT Key - apt_key: + ansible.builtin.apt_key: url: "{{ docker_apt_gpg_key }}" state: "{{ docker_apt_gpg_key_state }}" tags: - docker-conf-apt - name: Conf - Install APT Repository - apt_repository: + ansible.builtin.apt_repository: repo: "{{ docker_apt_repository }}" state: "{{ docker_apt_repository_state }}" update_cache: true 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 |