diff options
Diffstat (limited to 'ansible/roles')
10 files changed, 70 insertions, 37 deletions
diff --git a/ansible/roles/convert_openrc/tasks/main.yml b/ansible/roles/convert_openrc/tasks/main.yml index 1606b0bc5..00aa13615 100644 --- a/ansible/roles/convert_openrc/tasks/main.yml +++ b/ansible/roles/convert_openrc/tasks/main.yml @@ -18,7 +18,7 @@ - debug: var=openrc - set_fact: - yardstick_url_ip: "{{ openrc.OS_AUTH_URL|urlsplit|attr('hostname') }}" + yardstick_url_ip: "{{ openrc.OS_AUTH_URL|urlsplit('hostname') }}" - debug: var=yardstick_url_ip @@ -29,14 +29,8 @@ auth_url: "{{ openrc.OS_AUTH_URL }}" password: "{{ openrc.OS_PASSWORD }}" username: "{{ openrc.OS_USERNAME }}" - project_name: "{{ openrc.OS_PROJECT_NAME }}" -# tenant_name: "{{ openrc.OS_TENANT_NAME }}" + project_name: "{{ openrc.OS_PROJECT_NAME|default(openrc.OS_TENANT_NAME) }}" project_domain_name: "{{ openrc.OS_PROJECT_DOMAIN_NAME }}" -# user_domain_name: "{{ openrc.OS_USER_DOMAIN_NAME }}" - # BUGS: We need to specify identity_api_version == 3, but we can't do it here - # because it is not the write place - # we need to set it via OS_IDENTITY_API_VERSION or clouds.yaml -# identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}" - debug: var=os_auth @@ -44,7 +38,7 @@ clouds: demo: # must specify API version here - identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}" + identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION|default(3) }}" auth: "{{ os_auth }}" - template: diff --git a/ansible/roles/create_dockerfile/templates/centos/Dockerfile b/ansible/roles/create_dockerfile/templates/centos/Dockerfile index ca104c8f8..96d8a0041 100644 --- a/ansible/roles/create_dockerfile/templates/centos/Dockerfile +++ b/ansible/roles/create_dockerfile/templates/centos/Dockerfile @@ -18,7 +18,6 @@ ENV REPOS_DIR /home/opnfv/repos # Yardstick repo ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick -ENV RELENG_REPO_DIR ${REPOS_DIR}/releng RUN yum -y install\ deltarpm \ @@ -50,7 +49,6 @@ RUN yum -y install\ RUN mkdir -p ${REPOS_DIR} && \ git config --global http.sslVerify false && \ git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR} && \ - git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR} # install yardstick + dependencies # explicity pin pip version to avoid future issues like the ill-fated pip 8.0.0 release diff --git a/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile b/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile index 7fbc4f01a..6eba3a841 100644 --- a/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile +++ b/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile @@ -18,7 +18,6 @@ ENV REPOS_DIR /home/opnfv/repos # Yardstick repo ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick -ENV RELENG_REPO_DIR ${REPOS_DIR}/releng RUN sed -i -e 's/^deb /deb [arch=amd64] /g;s/^deb-src /# deb-src /g' /etc/apt/sources.list && \ echo "\n\ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted \n\ @@ -63,7 +62,6 @@ RUN apt-get update && apt-get install -y \ RUN mkdir -p ${REPOS_DIR} && \ git config --global http.sslVerify false && \ git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR} && \ - git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR} # install yardstick + dependencies # explicity pin pip version to avoid future issues like the ill-fated pip 8.0.0 release diff --git a/ansible/roles/create_storperf_admin_rc/tasks/main.yml b/ansible/roles/create_storperf_admin_rc/tasks/main.yml index bd1418e89..f63d1d814 100644 --- a/ansible/roles/create_storperf_admin_rc/tasks/main.yml +++ b/ansible/roles/create_storperf_admin_rc/tasks/main.yml @@ -12,15 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- name: Fetch TENANT_ID - os_project_facts: - name: admin - environment: "{{ openrc }}" - -- name: Fetch TENANT_ID - set_fact: - os_tenant_id: "{{ openstack_projects[0].id }}" - - name: Create storperf_admin-rc template: src: storperf_admin-rc.j2 diff --git a/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2 b/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2 index 410ab24df..888e87118 100644 --- a/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2 +++ b/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2 @@ -1,7 +1,5 @@ OS_AUTH_URL="{{ openrc.OS_AUTH_URL }}" OS_USERNAME="{{ openrc.OS_USERNAME|default('admin') }}" OS_PASSWORD="{{ openrc.OS_PASSWORD|default('console') }}" -OS_TENANT_NAME="{{ openrc.OS_TENANT_NAME|default('admin') }}" OS_VOLUME_API_VERSION="{{ openrc.OS_VOLUME_API_VERSION|default('2') }}" -OS_PROJECT_NAME="{{ openrc.OS_PROJECT_NAME|default(openrc.OS_TENANT_NAME) }}" -OS_TENANT_ID="{{ os_tenant_id }}" +OS_PROJECT_NAME="{{ openrc.OS_PROJECT_NAME|openrc.OS_TENANT_NAME|default('admin') }}" diff --git a/ansible/roles/download_l2fwd/defaults/main.yml b/ansible/roles/download_l2fwd/defaults/main.yml new file mode 100644 index 000000000..1bc76ef3e --- /dev/null +++ b/ansible/roles/download_l2fwd/defaults/main.yml @@ -0,0 +1,4 @@ +--- +l2fwd_url: "http://artifacts.opnfv.org/yardstick/third-party/l2fwd.tar" +l2fwd_file: "l2fwd.tar" +l2fwd_dest: "/home" diff --git a/ansible/roles/download_l2fwd/tasks/main.yml b/ansible/roles/download_l2fwd/tasks/main.yml new file mode 100644 index 000000000..7f2ea25c4 --- /dev/null +++ b/ansible/roles/download_l2fwd/tasks/main.yml @@ -0,0 +1,28 @@ +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- file: + path: "{{ l2fwd_dest }}" + state: directory + +- name: fetch dpdk + get_url: + url: "{{ l2fwd_url }}" + dest: "{{ l2fwd_dest }}" + +- unarchive: + src: "{{ l2fwd_dest }}/{{ l2fwd_file }}" + dest: "{{ l2fwd_dest }}/" + copy: no + mode: 0777 diff --git a/ansible/roles/infra_create_vms/tasks/configure_vm.yml b/ansible/roles/infra_create_vms/tasks/configure_vm.yml index 94f6f133e..7419fd565 100644 --- a/ansible/roles/infra_create_vms/tasks/configure_vm.yml +++ b/ansible/roles/infra_create_vms/tasks/configure_vm.yml @@ -328,7 +328,7 @@ - name: Resize image shell: > - qemu-img resize {{ image_dir+node_item.hostname+'.qcow2' }} {{ node_item.disk }}MB + qemu-img resize {{ image_dir+node_item.hostname+'.qcow2' }} {{ node_item.disk }}M - name: Define the VMs virt: diff --git a/ansible/roles/infra_destroy_previous_configuration/tasks/delete_vm.yml b/ansible/roles/infra_destroy_previous_configuration/tasks/delete_vm.yml new file mode 100644 index 000000000..5e43ee81e --- /dev/null +++ b/ansible/roles/infra_destroy_previous_configuration/tasks/delete_vm.yml @@ -0,0 +1,29 @@ +# Copyright (c) 2017-2018 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +# Ignore errors as VM can be destroyed without been undefined. +- name: Destroy old VMs + virt: + command: destroy + name: "{{ node_item.hostname }}" + when: node_item.hostname in virt_vms.list_vms + ignore_errors: yes + +# Ignore errors as VM can be running while undefined +- name: Undefine old VMs + virt: + command: undefine + name: "{{ node_item.hostname }}" + when: node_item.hostname in virt_vms.list_vms + ignore_errors: yes diff --git a/ansible/roles/infra_destroy_previous_configuration/tasks/main.yml b/ansible/roles/infra_destroy_previous_configuration/tasks/main.yml index 5595cd501..e6c2c0229 100644 --- a/ansible/roles/infra_destroy_previous_configuration/tasks/main.yml +++ b/ansible/roles/infra_destroy_previous_configuration/tasks/main.yml @@ -26,17 +26,10 @@ register: virt_vms - name: Destroy old VMs - virt: - command: destroy - name: "{{ item.hostname }}" - when: item.hostname in virt_vms.list_vms - with_items: "{{ infra_deploy_vars.nodes }}" - -- name: Undefine old VMs - virt: - command: undefine - name: "{{ item.hostname }}" - when: item.hostname in virt_vms.list_vms + include_tasks: delete_vm.yml + extra_vars: "{{ virt_vms }}" + loop_control: + loop_var: node_item with_items: "{{ infra_deploy_vars.nodes }}" - name: Delete old networks |