#SPDX-License-Identifier: MIT-0 --- # tasks file for base - name: Update apt cache ansible.builtin.apt: update_cache: true cache_valid_time: 3600 when: ansible_os_family == "Debian" - name: Install required packages for Docker ansible.builtin.apt: name: - apt-transport-https - ca-certificates - curl - gnupg - lsb-release - apache2-utils # for htpasswd state: present when: ansible_os_family == "Debian" - name: Install convenience packages ansible.builtin.apt: name: - htop - ncdu - vim - curl state: present when: ansible_os_family == "Debian" - name: Add Docker GPG key ansible.builtin.apt_key: url: https://download.docker.com/linux/debian/gpg state: present when: ansible_os_family == "Debian" - name: Add Docker repository ansible.builtin.apt_repository: repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" state: present when: ansible_os_family == "Debian" - name: Install Docker Engine and Docker Compose plugin ansible.builtin.apt: name: - docker-ce - docker-ce-cli - containerd.io - docker-buildx-plugin - docker-compose-plugin state: present update_cache: true when: ansible_os_family == "Debian" - name: Start and enable Docker service ansible.builtin.systemd: name: docker state: started enabled: true when: ansible_virtualization_type != "docker" - name: Set custom MOTD ansible.builtin.template: src: motd.j2 dest: /etc/motd owner: root group: root mode: '0644'