- name: Install
  apt:
    name: "{{ item }}"
    update_cache: yes
    cache_valid_time: 3600
    install_recommends: no
  with_items:
    - apt-transport-https
    - ca-certificates
    - curl
    - gnupg-agent
    - software-properties-common
  become: yes
- name: Add a key for the repository of Docker
  apt_key:
    url: 'https://download.docker.com/linux/ubuntu/gpg'
  become: yes
- name: Add the repository of Docker
  apt_repository:
    repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
    update_cache: yes
  become: yes
- name: Install Docker related packages
  apt:
    name: "{{ item }}"
    update_cache: yes
    cache_valid_time: 3600
    install_recommends: no
  with_items:
    - docker-ce
    - docker-ce-cli
    - containerd.io
  become: yes

- name: Install packages to allow apt to use a repository over HTTPS
  apt:
    name: "{{ item }}"
    update_cache: yes
    cache_valid_time: 3600
    install_recommends: no
  with_items:
    - apt-transport-https
    - ca-certificates
    - curl
    - gnupg-agent
    - software-properties-common
  become: yes
- name: Add a key for the repository of Docker
  apt_key:
    url: 'https://download.docker.com/linux/ubuntu/gpg'
  become: yes
- name: Add the repository of Docker
  apt_repository:
    repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
    update_cache: yes
  become: yes
- name: Install Docker related packages
  apt:
    name: "{{ item }}"
    update_cache: yes
    cache_valid_time: 3600
    install_recommends: no
  with_items:
    - docker-ce
    - docker-ce-cli
    - containerd.io
  become: yes

Improve task name for packages related to HTTPS.
Improve task name for packages related to HTTPS.
