playbook.yaml 741 B

1234567891011121314151617181920212223242526272829
  1. ---
  2. - hosts: all
  3. become: yes
  4. tasks:
  5. - name: install prerequisites
  6. apt:
  7. name:
  8. - apt-transport-https
  9. - ca-certificates
  10. - curl
  11. - gnupg-agent
  12. - software-properties-common
  13. update_cache: yes
  14. - name: add apt-key
  15. apt_key:
  16. url: https://download.docker.com/linux/ubuntu/gpg
  17. - name: add docker repo
  18. apt_repository:
  19. repo: deb https://download.docker.com/linux/ubuntu focal stable
  20. - name: install docker
  21. apt:
  22. name:
  23. - docker-ce
  24. - docker-ce-cli
  25. - containerd.io
  26. - docker-compose
  27. update_cache: yes
  28. - name: add userpermissions
  29. shell: "usermod -aG docker vagrant"