---
  - hosts: all
    become: yes
    tasks:
      - shell: |  
          sudo apt update -y
          sudo apt purge docker docker-engine docker.io containerd runc -y
          sudo apt autoremove -y           
      - shell: |
          sudo apt install docker.io -y
      
      - service:
          name: docker 
          state: start
      - service:
          name: docker
          enable: yes
      - name: print version of docker 
        command: docker --version
        register: dockerversion

      - debug:
          msg: "{{ dockerversion.stdout }}"      
