diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cf568411296a9d0703b5d97295c3e64742690648..68b0955b814dc2fde5520a7e6be1b6a995af8d76 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ variables:
 # us-west1-a
 
 before_script:
-    - pip install ansible
+    - pip install ansible==2.2.1.0
     - pip install netaddr
     - pip install apache-libcloud==0.20.1
     - pip install boto==2.9.0
@@ -66,7 +66,7 @@ before_script:
   stage: deploy-gce
   before_script:
     - docker info
-    - pip install ansible==2.1.3.0
+    - pip install ansible==2.2.1.0
     - pip install netaddr
     - pip install apache-libcloud==0.20.1
     - pip install boto==2.9.0
diff --git a/requirements.txt b/requirements.txt
index 74b24ce8c8cf481509025cbd42462fcea838deed..6fd09e6c7d5f6e9bc23afb8b0930470598ba640f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-ansible
+ansible>=2.2.1
 netaddr
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index cda74d29ba5ea9ef77444eab1b920a15d57d9950..ead2014081ef88387b1fc11d7c488fb3ef80fc93 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -69,7 +69,7 @@
   when: (not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]) and (docker_package_info.pkgs|length > 0)
 
 - name: check minimum docker version for docker_dns mode. You need at least docker version >= 1.12 for resolvconf_mode=docker_dns
-  shell: docker version -f "{{ '{{' }}.Client.Version{{ '}}' }}"
+  raw: docker version -f "{{ '{{' }}.Client.Version{{ '}}' }}"
   register: docker_version
   failed_when: docker_version.stdout|version_compare('1.12', '<')
   changed_when: false