- name: install python Crypto module
       package:
         name: "{{ python_crypto_package_name }}"
-    - name: install PyYAML
+    - name: install opnfv pip required packages
       pip:
-        name: pyyaml
+        name: "{{ item }}"
         state: present
+      with_items:
+        - pyyaml
+        - python-neutronclient
+        - python-openstackclient
     - name: generate password token
       command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml"
       args:
         content: "{{ xci_ssl_key }}"
         dest: "/etc/ssl/private/xci.key"
       become: true
-    - name: install opnfv required packages
-      package:
-        name: "{{ opnfv_required_packages }}"
-        state: latest
-    # Docker is needed for functest
-    - name: Ensure Docker service is started and enabled
-      service:
-        name: "{{ docker_service_name }}"
-        state: started
-        enabled: yes
-    - name: install opnfv required pip packages
-      pip:
-        name: "{{ opnfv_required_pip }}"
-        state: present
 
 - hosts: localhost
   remote_user: root
 
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+
+- name: install functest required packages
+  package:
+    name: "{{ functest_required_packages[ansible_pkg_mgr] }}"
+    state: present
+
+# Docker is needed for functest
+- name: Ensure Docker service is started and enabled
+  service:
+    name: docker
+    state: started
+    enabled: yes
+
+- name: install functest required pip packages
+  pip:
+   name: "{{ functest_required_pip }}"
+   state: present
+
 - name: check if the gateway was already set
   shell: "ip a | grep {{ gateway_ip }}"
   register: gateway_ip_result
     src: run-functest.sh.j2
     dest: /root/run-functest.sh
     mode: 0755
-
-- name: install required packages
-  package:
-    name: "{{ item }}"
-    state: present
-  with_items:
-    - wget
 
--- /dev/null
+---
+functest_required_packages:
+  apt:
+    - docker.io
+    - wget
+  zypper:
+    - docker
+    - wget
+  yum:
+    - docker
+    - wget
+
+functest_required_pip:
+  - docker-py
 
 ##############################################################################
 # this is the interface the VM nodes are connected to libvirt network "default"
 python_crypto_package_name: python-crypto
-docker_package_name: docker.io
-docker_service_name: docker
 
 ##############################################################################
 # this is placeholder and left blank intentionally to complete later on
 python_crypto_package_name: python-crypto
-docker_package_name: docker
-docker_service_name: docker
 
 ##############################################################################
 # this is the interface the VM nodes are connected to libvirt network "default"
 python_crypto_package_name: python-pycrypto
-docker_package_name: docker
-docker_service_name: docker
 
 HAPROXY_VERSION: "{{ lookup('env','HAPROXY_VERSION') }}"
 KEEPALIVED_GIT_URL: "{{ lookup('env','KEEPALIVED_GIT_URL') }}"
 KEEPALIVED_VERSION: "{{ lookup('env','KEEPALIVED_VERSION') }}"
-
-# install docker on opnfv host only if we are running as part of CI
-opnfv_required_packages:
-  - "{{ docker_package_name }}"
-
-opnfv_required_pip:
-  - python-openstackclient
-  - python-neutronclient
-  - docker-py