xci: Move functest required packages to the functest role 89/53389/8
authorMarkos Chandras <mchandras@suse.de>
Fri, 9 Mar 2018 09:17:16 +0000 (09:17 +0000)
committerMarkos Chandras <mchandras@suse.de>
Sat, 10 Mar 2018 09:49:56 +0000 (09:49 +0000)
The docker packages that we install in the OPNFV VM are needed by
functest so add them to the related role.

Change-Id: I6ebe76fd030859f757d41ecf20c30ab76888ee9c
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/installer/osa/playbooks/configure-opnfvhost.yml
xci/playbooks/roles/prepare-functest/tasks/main.yml
xci/playbooks/roles/prepare-functest/vars/main.yml [new file with mode: 0644]
xci/var/Debian.yml
xci/var/RedHat.yml
xci/var/Suse.yml
xci/var/opnfv.yml

index deeab18..202cf36 100644 (file)
     - 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
index 243358f..e781c4d 100644 (file)
@@ -7,6 +7,24 @@
 # 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
diff --git a/xci/playbooks/roles/prepare-functest/vars/main.yml b/xci/playbooks/roles/prepare-functest/vars/main.yml
new file mode 100644 (file)
index 0000000..3a6c8a4
--- /dev/null
@@ -0,0 +1,14 @@
+---
+functest_required_packages:
+  apt:
+    - docker.io
+    - wget
+  zypper:
+    - docker
+    - wget
+  yum:
+    - docker
+    - wget
+
+functest_required_pip:
+  - docker-py
index ad3621b..c785c65 100644 (file)
@@ -9,5 +9,3 @@
 ##############################################################################
 # 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
index 8ea2e15..eae7d12 100644 (file)
@@ -9,5 +9,3 @@
 ##############################################################################
 # 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
index 5066def..5891aee 100644 (file)
@@ -9,5 +9,3 @@
 ##############################################################################
 # 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
index d3924bf..f438e57 100644 (file)
@@ -43,12 +43,3 @@ OPENSTACK_OSA_HAPROXY_GIT_URL: "{{ lookup('env','OPENSTACK_OSA_HAPROXY_GIT_URL')
 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