--- - name: Update apt cache apt: update_cache: yes - name: Install utils retries: 3 delay: 5 ansible.builtin.apt: pkg: - ca-certificates - curl - gpg update_cache: yes cache_valid_time: 3600 - name: Make sure the APT keyring directory exists file: path: /etc/apt/keyrings state: directory mode: '0755' - name: Register the Docker GPG key with APT become: true ansible.builtin.apt_key: url: "{{ repo_key }}" state: present - name: Add Docker repository to APT sources apt_repository: repo: "{{ repo_url }}" state: present filename: docker - name: create user for remap user: name: "{{ remap_user }}" comment: "User for docker userns-remap" state: present create_home: false when: remap_enable - name: Install Docker-CE retries: 3 delay: 5 ansible.builtin.apt: pkg: - docker-ce update_cache: yes cache_valid_time: 3600 - meta: flush_handlers