From dc0fee7c092df7c2c1ff7627e33107969b46c6d2 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 9 Mar 2018 09:17:16 +0000 Subject: xci: Move functest required packages to the functest role 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 --- .../osa/playbooks/configure-opnfvhost.yml | 22 ++++++------------- .../roles/prepare-functest/tasks/main.yml | 25 ++++++++++++++++------ xci/playbooks/roles/prepare-functest/vars/main.yml | 14 ++++++++++++ xci/var/Debian.yml | 2 -- xci/var/RedHat.yml | 2 -- xci/var/Suse.yml | 2 -- xci/var/opnfv.yml | 9 -------- 7 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 xci/playbooks/roles/prepare-functest/vars/main.yml diff --git a/xci/installer/osa/playbooks/configure-opnfvhost.yml b/xci/installer/osa/playbooks/configure-opnfvhost.yml index deeab182..202cf361 100644 --- a/xci/installer/osa/playbooks/configure-opnfvhost.yml +++ b/xci/installer/osa/playbooks/configure-opnfvhost.yml @@ -103,10 +103,14 @@ - 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: @@ -135,20 +139,6 @@ 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 diff --git a/xci/playbooks/roles/prepare-functest/tasks/main.yml b/xci/playbooks/roles/prepare-functest/tasks/main.yml index 243358fc..e781c4df 100644 --- a/xci/playbooks/roles/prepare-functest/tasks/main.yml +++ b/xci/playbooks/roles/prepare-functest/tasks/main.yml @@ -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 @@ -27,10 +45,3 @@ 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 index 00000000..3a6c8a4d --- /dev/null +++ b/xci/playbooks/roles/prepare-functest/vars/main.yml @@ -0,0 +1,14 @@ +--- +functest_required_packages: + apt: + - docker.io + - wget + zypper: + - docker + - wget + yum: + - docker + - wget + +functest_required_pip: + - docker-py diff --git a/xci/var/Debian.yml b/xci/var/Debian.yml index ad3621b6..c785c65c 100644 --- a/xci/var/Debian.yml +++ b/xci/var/Debian.yml @@ -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 diff --git a/xci/var/RedHat.yml b/xci/var/RedHat.yml index 8ea2e15a..eae7d127 100644 --- a/xci/var/RedHat.yml +++ b/xci/var/RedHat.yml @@ -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 diff --git a/xci/var/Suse.yml b/xci/var/Suse.yml index 5066defa..5891aee9 100644 --- a/xci/var/Suse.yml +++ b/xci/var/Suse.yml @@ -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 diff --git a/xci/var/opnfv.yml b/xci/var/opnfv.yml index d3924bf0..f438e577 100644 --- a/xci/var/opnfv.yml +++ b/xci/var/opnfv.yml @@ -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 -- cgit 1.2.3-korg From f76dbbfafcdbc6acf6948f8dee60671211774567 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 8 Mar 2018 12:37:07 +0000 Subject: xci: OSA: Ensure proper constrains are applied to pip installations We need to make sure that the pip packages that we install are compatible with the OSA components. Change-Id: I87e80dc9b8fb862d9f9039d835b0908f752de3ca Signed-off-by: Markos Chandras --- xci/installer/osa/playbooks/configure-opnfvhost.yml | 2 ++ xci/playbooks/prepare-functest.yml | 3 +++ xci/playbooks/roles/prepare-functest/tasks/main.yml | 1 + 3 files changed, 6 insertions(+) diff --git a/xci/installer/osa/playbooks/configure-opnfvhost.yml b/xci/installer/osa/playbooks/configure-opnfvhost.yml index 202cf361..2996236b 100644 --- a/xci/installer/osa/playbooks/configure-opnfvhost.yml +++ b/xci/installer/osa/playbooks/configure-opnfvhost.yml @@ -11,6 +11,7 @@ remote_user: root vars_files: - "{{ XCI_PATH }}/xci/var/opnfv.yml" + - "{{ XCI_PATH }}/xci/installer/osa/files/openstack_services.yml" pre_tasks: - name: Load distribution variables @@ -107,6 +108,7 @@ pip: name: "{{ item }}" state: present + extra_args: '-c https://raw.githubusercontent.com/openstack/requirements/{{ requirements_git_install_branch }}/upper-constraints.txt' with_items: - pyyaml - python-neutronclient diff --git a/xci/playbooks/prepare-functest.yml b/xci/playbooks/prepare-functest.yml index 6d5b01c6..a4cb664b 100644 --- a/xci/playbooks/prepare-functest.yml +++ b/xci/playbooks/prepare-functest.yml @@ -16,5 +16,8 @@ - name: Prepare the environment for functest hosts: opnfv user: root + vars_files: + - ../var/opnfv.yml + - ../installer/osa/files/openstack_services.yml roles: - role: "prepare-functest" diff --git a/xci/playbooks/roles/prepare-functest/tasks/main.yml b/xci/playbooks/roles/prepare-functest/tasks/main.yml index e781c4df..2797ce43 100644 --- a/xci/playbooks/roles/prepare-functest/tasks/main.yml +++ b/xci/playbooks/roles/prepare-functest/tasks/main.yml @@ -24,6 +24,7 @@ pip: name: "{{ functest_required_pip }}" state: present + extra_args: '-c https://raw.githubusercontent.com/openstack/requirements/{{ requirements_git_install_branch }}/upper-constraints.txt' - name: check if the gateway was already set shell: "ip a | grep {{ gateway_ip }}" -- cgit 1.2.3-korg