---
# tasks file for docker
- name: install docker
  package:
    name: "{{ docker_packages }}"
    state: present
  register: docker_install_docker
  until: docker_install_docker is succeeded
  retries: 3

- name: install docker pip packages
  pip:
    name: "{{ docker_pip_packages }}"
    state: present
  register: docker_install_docker_pip_packages
  until: docker_install_docker_pip_packages is succeeded
  retries: 3

- name: add docker group
  group:
    name: docker
    system: yes

- name: start and enable docker
  service:
    name: "{{ docker_service }}"
    state: started
    enabled: yes
  when:
    - ansible_virtualization_type != "docker"
  notify:
    - change owner for docker socket
