diff --git a/ansible/roles/prechecks/tasks/package_checks.yml b/ansible/roles/prechecks/tasks/package_checks.yml index 5c927e63e4..ef8147fd99 100644 --- a/ansible/roles/prechecks/tasks/package_checks.yml +++ b/ansible/roles/prechecks/tasks/package_checks.yml @@ -2,10 +2,12 @@ - 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, '>=') diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index 8dcbda0fb9..262e6f7149 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -8,12 +8,14 @@ - name: Checking Docker version command: docker version register: result + changed_when: false failed_when: result | failed or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<') - name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared' command: cat /lib/systemd/system/docker.service register: result + changed_when: false failed_when: result.stdout.find('MountFlags=shared') == -1 when: - (inventory_hostname in groups['neutron-dhcp-agent'] @@ -25,6 +27,7 @@ - name: Checking if '/run' mount flag is set to 'shared' command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo register: result + changed_when: false failed_when: result.stdout.find('shared') == -1 when: - (inventory_hostname in groups['neutron-dhcp-agent']