diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 3e67224..2e78b9f 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -6,25 +6,39 @@ tasks: - name: Install docker ansible.builtin.apt: - name: docker.io - state: present - - name: Install telnet - ansible.builtin.apt: - name: telnet - state: present - - name: Install net-tools - ansible.builtin.apt: - name: net-tools - state: present - - name: Install curl! - ansible.builtin.apt: - name: curl - state: present - - name: Install deps... - ansible.builtin.apt: - name: + name: + - ca-certificates + - curl + - telnet + - net-tools - python3-pip - python3-dev + state: present + - name: Get keys for raspotify + ansible.builtin.shell: + install -m 0755 -d /etc/apt/keyrings + - name: Get keys for raspotify + ansible.builtin.shell: + curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc + - name: Get keys for raspotify + ansible.builtin.shell: + chmod a+r /etc/apt/keyrings/docker.asc + + - name: Get keys for raspotify + ansible.builtin.shell: - + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + - name: Install docker + ansible.builtin.apt: + name: + - docker-ce + - docker-ce-cli + - containerd.io + - docker-buildx-plugin + - docker-compose-plugin + - name: Create a directory docker.service.d ansible.builtin.file: path: /etc/systemd/system/docker.service.d/ @@ -35,9 +49,11 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - + ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 + # - name: Just force systemd to reread configs + # ansible.builtin.systemd_service: + # daemon_reload: true - name: Restart docker service ansible.builtin.service: