---
- name: check for docker.io
  shell: "dpkg -l docker.io | grep docker.io | cut -d' '  -f1"
  register: universe_check

# Updated due to bug #24
- name: check for lxc-docker
  shell: "dpkg -l lxc-docker-{{version}} | grep lxc-docker | cut -d' '  -f1"
  register: latest_check

- set_fact:
    universe_installed: "{{universe_check.stdout == 'ii'}}"
    latest_installed: "{{latest_check.stdout == 'ii'}}"

- set_fact:
    docker_version_name: docker
  when: latest_installed == "True"

- set_fact:
    docker_version_name: docker.io
  when: universe_installed == "True"


---
- name: check for docker.io
  shell: "dpkg -l docker.io | grep docker.io | cut -d' '  -f1"
  register: universe_check

# Updated due to bug #24
- name: check for latest-docker
  shell: "dpkg -l docker-engine | grep docker-engine | cut -d' '  -f1"
  register: latest_check

- set_fact:
    universe_installed: "{{universe_check.stdout == 'ii'}}"
    latest_installed: "{{latest_check.stdout == 'ii'}}"

- set_fact:
    docker_version_name: docker
  when: latest_installed == "True"

- set_fact:
    docker_version_name: docker.io
  when: universe_installed == "True"


Check for docker-engine package and not lxc-docker
Check for docker-engine package and not lxc-docker
