---
# Set up Docker

- include_role:
    name: docker-prerequisites

# Dynamically include docker installation role using 'when' as Ansible does not
# allow for include_role's name to be set to a variable. Indeed:
#     - include_role:
#         name: '{{ docker_install_role }}'
# fails with:
#     ERROR! 'docker_install_role' is undefined
- include_role:
    name: docker-from-docker-repo
  when: docker_install_role == 'docker-from-docker-repo'

- include_role:
    name: docker-from-docker-ce-repo
  when: docker_install_role == 'docker-from-docker-ce-repo'

- include_role:
    name: docker-from-get.docker.com
  when: docker_install_role == 'docker-from-get.docker.com'

- include_role:
    name: docker-from-tarball
  when: docker_install_role == 'docker-from-tarball'

- include_role:
    name: docker-configuration
