- name: Install required system packages by yum
  block:
    - name: Install tools
      yum:
        name:
          - yum-utils
          - device-mapper-persistent-data
          - lvm2
        state: latest

    - name: Install required python packages
      pip:
        name:
          - netaddr

    - name: Add Docker repo
      get_url:
        url: https://download.docker.com/linux/centos/docker-ce.repo
        dest: /etc/yum.repos.d/docker-ce.repo
      become: yes

    - name: Install Docker
      yum:
        name:
        - docker-ce
        - docker-ce-cli
        - containerd.io
        state: present

