--- - 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: command ansible --version register: result changed_when: false failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_max, '>=') # If this fails run "apt-get install linux-image-generic-lts-wily" - name: Checking LTS wily kernel version 4.2 on Ubuntu 14.04 command: uname -r register: result changed_when: false failed_when: result.stdout | regex_replace('(\\d+\\.\\d+).*', '\\1') | version_compare(ubuntu_kernel_version_min, '<') when: - ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'