---
- name: Checking docker-py version
  command: python -c "import docker; print docker.__version__"
  register: result
  changed_when: false
  failed_when: result | failed or
               result.stdout | version_compare(docker_py_version_min, '<')

- name: Checking Ansible version
  local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}"
  run_once: true
  when: ansible_version.full | version_compare(ansible_version_min, '<')

---
- name: Checking docker-py version
  command: "{{ ansible_python.executable }} -c \"import docker; print docker.__version__\""
  register: result
  changed_when: false
  failed_when: result | failed or
               result.stdout | version_compare(docker_py_version_min, '<')

- name: Checking Ansible version
  local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}"
  run_once: true
  when: ansible_version.full | version_compare(ansible_version_min, '<')

Support non standard Python path
Support non standard Python path

 * Fixes package check when ansible_python_interpreter
   config is used in inventory file.

Change-Id: Ia8b659057460c669be5f53ba2b3bf4625e496fe9
