diff options
Diffstat (limited to 'ansible')
27 files changed, 227 insertions, 152 deletions
diff --git a/ansible/multi_port_baremetal_ixia_correlated_test.yaml b/ansible/baremetal_scale_out_ixia_correlated_test.yaml index 0d223181d..13f6fef15 100644 --- a/ansible/multi_port_baremetal_ixia_correlated_test.yaml +++ b/ansible/baremetal_scale_out_ixia_correlated_test.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation. # +# Copyright (c) 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 @@ -112,6 +112,7 @@ ip: mgmt: - '1.2.1.6/24' + - '1.2.1.7/24' uplink: - '152.16.100.10/24' - '172.16.100.10/24' @@ -127,6 +128,6 @@ - '00:00:00:9e:00:fb' tasks: - - include: multi_port_baremetal_ixia_correlated_test_templates.yml + - include: baremetal_scale_out_ixia_correlated_test_templates.yml with_items: "{{ scale_out }}" diff --git a/ansible/multi_port_baremetal_ixia_correlated_test_templates.yml b/ansible/baremetal_scale_out_ixia_correlated_test_templates.yml index 6f73d8c01..11d3d4674 100644 --- a/ansible/multi_port_baremetal_ixia_correlated_test_templates.yml +++ b/ansible/baremetal_scale_out_ixia_correlated_test_templates.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation. # +# Copyright (c) 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 @@ -15,6 +15,10 @@ - set_fact: num_vnfs: "{{ item }}" +- file: + path: /etc/yardstick/nodes + state: directory + - debug: var: num_vnfs verbosity: 2 @@ -24,33 +28,33 @@ dest: ../samples/vnf_samples/traffic_profiles/ipv4_throughput-ixia-{{ num_vnfs }}.yaml - template: - src: ../etc/yardstick/nodes/standalone/ixia_template.yaml - dest: /etc/yardstick/nodes/ixia_{{ num_vnfs }}.yaml + src: ../etc/yardstick/nodes/standalone/ixia_correlated_template.yaml + dest: /etc/yardstick/nodes/ixia_correlated_{{ num_vnfs }}.yaml - template: - src: ../etc/yardstick/nodes/standalone/pod_bm_vnf.yaml + src: ../etc/yardstick/nodes/standalone/pod_bm_vnf_scale_out.yaml dest: /etc/yardstick/nodes/pod_bm_vnf_{{num_vnfs}}.yaml - template: - src: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_udp_ixia_correlated_multi_port_template.yaml - dest: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_udp_ixia_correlated_multi_port_{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_udp_ixia_correlated_scale_out_template.yaml + dest: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_udp_ixia_correlated_scale_out_{{ num_vnfs }}.yaml - template: - src: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-ixia-correlated-multi-port.yaml - dest: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-ixia-correlated-multi-port-{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-ixia-correlated-scale-out.yaml + dest: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-ixia-correlated-scale-out-{{ num_vnfs }}.yaml - template: - src: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_udp_ixia_correlated_multi_port_template.yaml - dest: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_udp_ixia_correlated_multi_port_{{num_vnfs}}.yaml + src: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_udp_ixia_correlated_scale_out_template.yaml + dest: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_udp_ixia_correlated_scale_out_{{num_vnfs}}.yaml - template: - src: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-correlated-multi-port.yaml - dest: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-correlated-multi-port-{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-correlated-scale-out.yaml + dest: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-correlated-scale-out-{{ num_vnfs }}.yaml - template: - src: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_udp_ixia_correlated_multi_port_template.yaml - dest: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_udp_ixia_correlated_multi_port_{{num_vnfs}}.yaml + src: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_udp_ixia_correlated_scale_out_template.yaml + dest: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_udp_ixia_correlated_scale_out_{{num_vnfs}}.yaml - template: - src: ../samples/vnf_samples/nsut/cgnapt/cgnapt-tg-topology-ixia-correlated-multi-port.yaml - dest: ../samples/vnf_samples/nsut/cgnapt/cgnapt-tg-topology-ixia-correlated-multi-port-{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/cgnapt/cgnapt-tg-topology-ixia-correlated-scale-out.yaml + dest: ../samples/vnf_samples/nsut/cgnapt/cgnapt-tg-topology-ixia-correlated-scale-out-{{ num_vnfs }}.yaml diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml index 072c12c66..495a547bb 100644 --- a/ansible/build_yardstick_image.yml +++ b/ansible/build_yardstick_image.yml @@ -19,11 +19,13 @@ 'amd64': disk1 'arm64': uefi1 boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}" - image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img" - image_path: "{{ release }}/current/{{ image_filename }}" + image_filename: + 'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img" + 'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img" + image_path: "{{ release }}/current/{{ image_filename[release] }}" host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}" image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}" - image_dest: "{{ workspace }}/{{ image_filename }}" + image_dest: "{{ workspace }}/{{ image_filename[release] }}" sha256sums_path: "{{ release }}/current/SHA256SUMS" sha256sums_filename: "{{ sha256sums_path|basename }}" sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}" diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 596560508..0e8ad5bc5 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1,9 +1,9 @@ ---
target_os: "Ubuntu"
YARD_IMG_ARCH: "amd64"
-IMG_PROPERTY: "normal"
+IMG_PROPERTY: "{{ IMAGE_PROPERTY | default('normal') }}"
clone_dest: /opt/tempT
-release: xenial
+release: "{{ OS_RELEASE | default('xenial') }}"
normal_image_file: "{{ workspace }}/yardstick-image.img"
nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"
ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
diff --git a/ansible/install.yaml b/ansible/install.yaml index 0800ee534..0c7ad7e92 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -21,7 +21,7 @@ pre_tasks: - - name: Create NSB binaries directory, accesible to any user + - name: Create NSB binaries directory, accessible to any user file: path: "{{ nsb_dir }}" state: directory @@ -31,15 +31,15 @@ - installation_mode != inst_mode_container_pull roles: - - { role: add_repos_jumphost, when: installation_mode != inst_mode_container_pull } - - { role: install_dependencies_jumphost, when: installation_mode != inst_mode_container_pull } + - add_repos_jumphost + - install_dependencies_jumphost - { role: install_yardstick, when: installation_mode != inst_mode_container_pull } - { role: configure_uwsgi, when: installation_mode != inst_mode_container_pull } - { role: configure_nginx, when: installation_mode != inst_mode_container_pull } - { role: configure_gui, when: installation_mode != inst_mode_container_pull } - { role: download_trex, when: installation_mode != inst_mode_container_pull } - { role: install_trex, when: installation_mode != inst_mode_container_pull } - - { role: configure_rabbitmq, when: installation_mode != inst_mode_container_pull } + - { role: configure_rabbitmq, when: installation_mode == inst_mode_baremetal } post_tasks: @@ -63,8 +63,8 @@ - role: set_package_installer_proxy when: proxy_env is defined and proxy_env # can't update grub in chroot/docker - # ?? - enable_iommu_on_boot - enable_hugepages_on_boot + - enable_iommu_on_boot # needed for collectd plugins - increase_open_file_limits - install_image_dependencies @@ -142,10 +142,6 @@ tasks: - include_role: - name: install_dependencies_jumphost - when: installation_mode == inst_mode_container_pull - - - include_role: name: docker when: installation_mode == inst_mode_container_pull diff --git a/ansible/library/fetch_url_and_verify.py b/ansible/library/fetch_url_and_verify.py index 6c5c0a8c2..13e8608b2 100644 --- a/ansible/library/fetch_url_and_verify.py +++ b/ansible/library/fetch_url_and_verify.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# pylint: disable-all + DOCUMENTATION = ''' --- module: fetch_url_and_verify @@ -42,6 +44,7 @@ def main(): dest = params['dest'] sha256url = params['sha256url'] retries = params['retries'] + sha256line = '' image_dir, image_filename = os.path.split(dest) rc, stdout, stderr = module.run_command(['curl', '-sS', sha256url]) @@ -59,7 +62,7 @@ def main(): module.exit_json(changed=False, dest=dest, url=url, sha256sum=sha256sum) - for retry in range(retries): + for _ in range(retries): curl_rc, stdout, stderr = module.run_command( ['curl', '-sS', '-o', dest, url], cwd=image_dir) if curl_rc == 0: @@ -74,7 +77,7 @@ def main(): # <<INCLUDE_ANSIBLE_MODULE_COMMON>> -from ansible.module_utils.basic import * # noqa +from ansible.module_utils.basic import * if __name__ == '__main__': main() diff --git a/ansible/multi_port_baremetal_ixia_test_templates.yml b/ansible/multi_port_baremetal_ixia_test_templates.yml index f2e04a2d1..832f025a1 100644 --- a/ansible/multi_port_baremetal_ixia_test_templates.yml +++ b/ansible/multi_port_baremetal_ixia_test_templates.yml @@ -15,6 +15,10 @@ - set_fact: num_vnfs: "{{ item }}" +- file: + path: /etc/yardstick/nodes + state: directory + - debug: var: num_vnfs verbosity: 2 @@ -25,15 +29,15 @@ - template: src: ../etc/yardstick/nodes/standalone/ixia_template.yaml - dest: /etc/yardstick/nodes/ixia_{{ num_vnfs }}.yaml + dest: /etc/yardstick/nodes/baremetal_ixia_{{ num_vnfs }}.yaml - template: src: ../etc/yardstick/nodes/standalone/pod_bm_vnf.yaml dest: /etc/yardstick/nodes/pod_bm_vnf_{{num_vnfs}}.yaml - template: - src: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_rfc2544_template.yaml - dest: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_rfc2544_{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_rfc2544_ixia_template.yaml + dest: ../samples/vnf_samples/nsut/vfw/tc_baremetal_vfw_rfc2544_ixia_{{ num_vnfs }}.yaml - template: src: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-ixia-multi-port.yaml @@ -45,7 +49,7 @@ - template: src: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-multi-port.yaml - dest: ../samples/vnf_samples/nsut/acl/acl-tg-topology-multi-port-ixia-{{ num_vnfs }}.yaml + dest: ../samples/vnf_samples/nsut/acl/acl-tg-topology-ixia-multi-port-{{ num_vnfs }}.yaml - template: src: ../samples/vnf_samples/traffic_profiles/ipv4_throughput-cgnapt-scale-out.yaml diff --git a/ansible/multi_port_baremetal_test_templates.yml b/ansible/multi_port_baremetal_test_templates.yml index 4b905f8c7..2d0259364 100644 --- a/ansible/multi_port_baremetal_test_templates.yml +++ b/ansible/multi_port_baremetal_test_templates.yml @@ -15,6 +15,10 @@ - set_fact: num_vnfs: "{{ item }}" +- file: + path: /etc/yardstick/nodes + state: directory + - debug: var: num_vnfs verbosity: 2 @@ -40,8 +44,8 @@ dest: ../samples/vnf_samples/nsut/vfw/vfw-tg-topology-multi-port-{{ num_vnfs }}.yaml - template: - src: ../samples/vnf_samples/nsut/acl/tc_baremetal_vfw_rfc2544_template.yaml - dest: ../samples/vnf_samples/nsut/acl/tc_baremetal_vfw_rfc2544_{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_rfc2544_template.yaml + dest: ../samples/vnf_samples/nsut/acl/tc_baremetal_acl_rfc2544_{{ num_vnfs }}.yaml - template: src: ../samples/vnf_samples/nsut/acl/acl-tg-topology-multi-port.yaml @@ -52,8 +56,8 @@ dest: ../samples/vnf_samples/traffic_profiles/ipv4_throughput-cgnapt-{{ num_vnfs }}.yaml - template: - src: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_vfw_rfc2544_template.yaml - dest: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_vfw_rfc2544_{{ num_vnfs }}.yaml + src: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_rfc2544_template.yaml + dest: ../samples/vnf_samples/nsut/cgnapt/tc_baremetal_cgnapt_rfc2544_{{ num_vnfs }}.yaml - template: src: ../samples/vnf_samples/nsut/cgnapt/cgnapt-tg-topology-multi-port.yaml diff --git a/ansible/prepare_openstack.yml b/ansible/prepare_openstack.yml index 6f54ef522..c9067c9fb 100644 --- a/ansible/prepare_openstack.yml +++ b/ansible/prepare_openstack.yml @@ -23,7 +23,6 @@ include: build_yardstick_image.yml vars: YARD_IMG_ARCH: amd64 - release: xenial img_property: nsb - name: Cleanup old OpenStack images and upload the new one diff --git a/ansible/roles/add_repos_jumphost/tasks/Debian.yml b/ansible/roles/add_repos_jumphost/tasks/Debian.yml index 626f0b037..e15699617 100644 --- a/ansible/roles/add_repos_jumphost/tasks/Debian.yml +++ b/ansible/roles/add_repos_jumphost/tasks/Debian.yml @@ -71,7 +71,6 @@ deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }} main universe multiverse restricted deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-updates main universe multiverse restricted deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-security main universe multiverse restricted - deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-proposed main universe multiverse restricted when: installation_mode == "container" - name: Remove the marker diff --git a/ansible/roles/barometer_collectd/tasks/main.yaml b/ansible/roles/barometer_collectd/tasks/main.yaml new file mode 100644 index 000000000..c06540c3f --- /dev/null +++ b/ansible/roles/barometer_collectd/tasks/main.yaml @@ -0,0 +1,40 @@ +#Copyright 2018 OPNFV and 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. +--- + +- name: Remove barometer-collectd container + docker_container: + name: barometer-collectd + state: absent + +- name: Remove barometer-collectd image + docker_image: + name: opnfv/barometer-collectd + state: absent + +- name: Prepare collectd container + docker_container: + name: barometer-collectd + image: opnfv/barometer-collectd + volumes: + - /opt/collectd/etc/collectd.conf.d/:/opt/collectd/etc/collectd.conf.d + - /var/run:/var/run + - /tmp:/tmp + - /var/lib/collectd:/var/lib/collectd + command: "/run_collectd.sh" + detach: yes + state: present + restart: no + privileged: yes + network_mode: host diff --git a/ansible/roles/build_yardstick_image/vars/main.yml b/ansible/roles/build_yardstick_image/vars/main.yml index 6728e5afb..3d4054408 100644 --- a/ansible/roles/build_yardstick_image/vars/main.yml +++ b/ansible/roles/build_yardstick_image/vars/main.yml @@ -16,11 +16,13 @@ boot_modes: 'amd64': disk1
'arm64': uefi1
boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}"
-image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
-image_path: "{{ release }}/current/{{ image_filename }}"
+image_filename:
+ 'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
+ 'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img"
+image_path: "{{ release }}/current/{{ image_filename[release] }}"
host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}"
image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}"
-image_dest: "{{ workspace }}/{{ image_filename }}"
+image_dest: "{{ workspace }}/{{ image_filename[release] }}"
sha256sums_path: "{{ release }}/current/SHA256SUMS"
sha256sums_filename: "{{ sha256sums_path|basename }}"
sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}"
diff --git a/ansible/roles/configure_gui/tasks/main.yml b/ansible/roles/configure_gui/tasks/main.yml index 846a9cb47..665053ccf 100644 --- a/ansible/roles/configure_gui/tasks/main.yml +++ b/ansible/roles/configure_gui/tasks/main.yml @@ -27,6 +27,11 @@ state: directory recurse: yes +- name: Remove /etc/nginx/yardstick/gui/dist directory if it exists + file: + path: /etc/nginx/yardstick/gui/dist + state: absent + - name: Move dist to /etc/nginx/yardstick/gui shell: cmd: mv dist /etc/nginx/yardstick/gui diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 4ff4222dc..3ad60c1ea 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,16 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- name: Create rabbitmq configuration - template: - src: rabbitmq.config.j2 - dest: /etc/rabbitmq/rabbitmq.config - -- name: Define user definitions file - template: - src: user_definitions.json.j2 - dest: /etc/rabbitmq/definitions.json - - name: Restart rabbitmq service: name: rabbitmq-server @@ -30,5 +20,11 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Enable management plugin - shell: rabbitmq-plugins enable rabbitmq_management +- name: Configure rabbitmq + rabbitmq_user: + user: yardstick + password: yardstick + configure_priv: .* + read_priv: .* + write_priv: .* + state: present diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 deleted file mode 100644 index 8f07edf5c..000000000 --- a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 +++ /dev/null @@ -1,5 +0,0 @@ - [
- {rabbitmq_management, [
- {load_definitions, "/etc/rabbitmq/definitions.json"}
- ]}
-].
\ No newline at end of file diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 deleted file mode 100644 index 7c811f16d..000000000 --- a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 +++ /dev/null @@ -1,23 +0,0 @@ - {
- "users": [{
- "name": "yardstick",
- "password_hash": "XHp9fBOE3vjTEf7ktiUBHqefW2g=",
- "hashing_algorithm": "rabbit_password_hashing_sha256",
- "tags": ""
- }],
- "vhosts": [{
- "name": "/"
- }],
- "permissions": [{
- "user": "yardstick",
- "vhost": "/",
- "configure": ".*",
- "write": ".*",
- "read": ".*"
- }],
- "parameters": [],
- "policies": [],
- "queues": [],
- "exchanges": [],
- "bindings": []
-}
diff --git a/ansible/roles/docker/tasks/Debian.yml b/ansible/roles/docker/tasks/Debian.yml index 7f998de45..a03040d88 100644 --- a/ansible/roles/docker/tasks/Debian.yml +++ b/ansible/roles/docker/tasks/Debian.yml @@ -14,3 +14,19 @@ --- - name: Install docker.io action: "{{ ansible_pkg_mgr }} name=docker.io state=present force=yes" + + - name: Update package manager cache + tags: + - cache_update + package: + update_cache: yes + + - name: Install python-pip + package: + name: python-pip + state: present + + - name: Install docker-py + pip: + name: docker-py + state: present diff --git a/ansible/roles/download_drivers/defaults/main.yml b/ansible/roles/download_drivers/defaults/main.yml index ab68a3c6d..bf1e48a23 100644 --- a/ansible/roles/download_drivers/defaults/main.yml +++ b/ansible/roles/download_drivers/defaults/main.yml @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -i40evf_version: "3.4.2" +i40evf_version: "3.5.13" i40evf_gzfile: "i40evf-{{ i40evf_version }}.tar.gz" i40evf_url: "https://netix.dl.sourceforge.net/project/e1000/i40evf%20stable/{{ i40evf_version }}/{{ i40evf_gzfile }}" i40evf_dest: "{{ clone_dest }}/" i40evf_path: "{{ i40evf_dest }}/{{ i40evf_gzfile|regex_replace('[.]tar[.]gz$', '') }}" i40evf_checksum: "3.4.2": "sha256:a8e2a722fb2f8ac874cb39545a331761841f1724830ff1581d2012dd37314645" + "3.5.13": "sha256:e57b95b694c8480b905e72ea13caac8714d6bb0c9eabe37cca655505b808f033"
\ No newline at end of file diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml index 1b98a50b1..188b32915 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/main.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# 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. @@ -22,51 +22,57 @@ iommu_boot_params: ' amd_iommu=on iommu=pt' when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD" -- name: Set facts for this role - set_fact: - hugepages_help_string: ' # added by hugepages role' - iommu_help_string: ', added by iommu role' - hugepages_params: " default_hugepagesz=1G hugepagesz=1G hugepages=8" - iommu_original_kernel_params: 'GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX{{ hugepages_params }}' - iommu_enabled_kernel_params: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"' - iommu_enabled_kernel_params_with_help: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' +- block: + - name: Define grub string for IOMMU + set_fact: + enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}' -- name: check if iommu is set by this role in /etc/default/grub - lineinfile: - path: /etc/default/grub - line: '{{ iommu_enabled_kernel_params_with_help }}' - #changed_when: no - check_mode: yes - register: is_mine_iommu_etc_grub - ignore_errors: True + - name: check if iommu is set by this role in {{ grub_file}} + lineinfile: + path: "{{ grub_file}}" + regexp: '{{ iommu_help_string }}' + line: '{{ iommu_help_string }}' + state: absent + check_mode: yes + register: is_nsb_iommu_role + ignore_errors: True -- name: check if iommu is set by someone else - command: "grep -o 'iommu' /etc/default/grub" - register: is_iommu - ignore_errors: True + - name: Check if IOMMU is set by someone else + lineinfile: + path: "{{ grub_file}}" + regexp: "_iommu=" + line: '{{ iommu_help_string }}' + state: absent + check_mode: yes + register: is_iommu + ignore_errors: True -- fail: - msg: "Iommu already set by someone else" - when: is_mine_iommu_etc_grub.changed == false and is_iommu.stdout != "" + - name: Send info that IOMMU is configured by someone else + debug: + msg: "INFO: NOT modified, IOMMU is already configured by someone." + when: + - not is_nsb_iommu_role.changed + - is_iommu.changed -- name: 'Configure iommu in /etc/default/grub' -# and /boot/grub/grub.cfg(when: ansible_distribution == "Ubuntu")' - lineinfile: - path: /etc/default/grub - regexp: '({{ iommu_original_kernel_params }})"{{ hugepages_help_string }}' - line: '\1{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' - backrefs: yes - when: is_mine_iommu_etc_grub.changed == true + - name: Add IOMMU when it is not set + lineinfile: + path: "{{ grub_file }}" + regexp: "{{ iommu_help_string }}" + line: '{{ enable_iommu }}" {{ iommu_help_string }}' + when: + - not is_nsb_iommu_role.changed + - not is_iommu.changed -- name: find boot grub.cfg - find: - paths: /boot - file_type: file - patterns: 'grub*.cfg' - recurse: yes - register: grub_files + - name: find boot grub.cfg + find: + paths: /boot + file_type: file + patterns: 'grub*.cfg' + recurse: yes + register: grub_files -- include: manual_modify_grub.yml - # only tested on Ubuntu, kernel line is probably different on other distros - with_items: "{{ grub_files.files }}" - when: ansible_distribution == "Ubuntu" + - include: manual_modify_grub.yml + # only tested on Ubuntu, kernel line is probably different on other distros + with_items: "{{ grub_files.files }}" + when: ansible_distribution == "Ubuntu" + when: iommu_boot_params is defined diff --git a/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml index 6760c3f9d..e0c880912 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# 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. @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. --- - - - name: check if iommu is set by this role in /boot grub.cfg files lineinfile: path: "{{ item.path }}" - regexp: '{{ hugepages_params }}{{ iommu_boot_params }}' - line: '' - #changed_when: no + regexp: '{{ iommu_boot_params }}' + line: '{{ iommu_boot_params }}' + state: absent check_mode: yes register: is_mine_iommu_boot_grub ignore_errors: True @@ -29,6 +27,6 @@ path: "{{ item.path }}" regexp: '(.*linux\s+/boot/vmlinuz.*)$' replace: '\1{{ iommu_boot_params }}' - when: is_mine_iommu_boot_grub.msg != "line replaced" + when: not is_mine_iommu_boot_grub.changed - debug: var=ansible_kernel diff --git a/ansible/roles/enable_iommu_on_boot/vars/main.yml b/ansible/roles/enable_iommu_on_boot/vars/main.yml index 1b642dcb5..d2575ffd6 100644 --- a/ansible/roles/enable_iommu_on_boot/vars/main.yml +++ b/ansible/roles/enable_iommu_on_boot/vars/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# 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. @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +grub_file: "/etc/default/grub" +iommu_help_string: ' # added by Yardstick ansible iommu role' update_grub: Debian: "update-grub2" RedHat: "grub2-mkconfig -o /boot/grub2/grub.cfg" diff --git a/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml b/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml index 9baf7e59e..6c3900d26 100755 --- a/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml +++ b/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml @@ -16,6 +16,12 @@ apt: update_cache: yes +- name: Install dependency for Ubuntu 18 + action: "{{ ansible_pkg_mgr }} name=libssl1.0-dev state=present" + when: + - ansible_distribution == 'Ubuntu' + - ansible_distribution_major_version|int >= 17 + - name: Install core packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: @@ -29,20 +35,17 @@ - vim - libffi-dev - libfuse-dev - - libssl-dev - libxft-dev - libxml2-dev - libxss-dev - - libxslt-dev - libxslt1-dev - - libzmq-dev + - libzmq3-dev - qemu-user-static - qemu-utils - kpartx - python - python-setuptools - python-dev - - python-pip - python-libvirt - python-virtualenv - bridge-utils @@ -54,7 +57,6 @@ - uwsgi-plugin-python - supervisor - lsof - - nodejs - npm - rabbitmq-server @@ -74,3 +76,23 @@ - name: Remove useless packages from the cache apt: autoclean: yes + +# There is a bug with the easy install ansible module in Ubuntu 16.04 linux. +# Refer https://github.com/ansible/ansible/issues/23534 +- name: Install pip + shell: easy_install -U pip + when: + - ansible_distribution == 'Ubuntu' + - ansible_distribution_major_version|int <= 16 + +- name: Install python-pip + action: "{{ ansible_pkg_mgr }} name=python-pip state=present" + when: + - ansible_distribution == 'Ubuntu' + - ansible_distribution_major_version|int >= 17 + +- name: Install required docker-py module + pip: + name: docker-py + state: latest + environment: "{{ proxy_env }}" diff --git a/ansible/roles/install_dependencies_jumphost/tasks/RedHat.yml b/ansible/roles/install_dependencies_jumphost/tasks/RedHat.yml index 85eb1156a..cb5315adb 100644 --- a/ansible/roles/install_dependencies_jumphost/tasks/RedHat.yml +++ b/ansible/roles/install_dependencies_jumphost/tasks/RedHat.yml @@ -52,3 +52,4 @@ - openssl - python-virtualenv - ccze + - python-pip diff --git a/ansible/roles/install_dependencies_jumphost/tasks/Suse.yml b/ansible/roles/install_dependencies_jumphost/tasks/Suse.yml index af53c9cd5..7932ed96d 100644 --- a/ansible/roles/install_dependencies_jumphost/tasks/Suse.yml +++ b/ansible/roles/install_dependencies_jumphost/tasks/Suse.yml @@ -47,3 +47,9 @@ - openssl - python-virtualenv - ccze + +# There is a bug with the easy install ansible module in suse linux. +# Until this is fixed the shell command must be used +# Refer https://github.com/ansible/ansible/issues/37296 +- name: Install pip + shell: easy_install -U pip diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml index 4f0c3c881..b76a0fbf8 100755 --- a/ansible/roles/install_dpdk/tasks/Debian.yml +++ b/ansible/roles/install_dpdk/tasks/Debian.yml @@ -17,6 +17,7 @@ with_items: - libpcap-dev - pciutils + - libelf-dev - name: Install kernel headers action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present" diff --git a/ansible/roles/install_yardstick/tasks/main.yml b/ansible/roles/install_yardstick/tasks/main.yml index 203acc3e5..f93f8eec3 100644 --- a/ansible/roles/install_yardstick/tasks/main.yml +++ b/ansible/roles/install_yardstick/tasks/main.yml @@ -29,14 +29,6 @@ scope: global value: False -# There is a bug with the easy install ansible module in suse linux. -# Until this is fixed the shell command must be used -- name: Install pip - shell: easy_install -U pip -# easy_install: -# name: pip -# state: latest - - name: Install Yardstick requirements (venv) pip: requirements: "{{ yardstick_dir }}/requirements.txt" diff --git a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml index 3a29a8a90..84e1f9adf 100644 --- a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml +++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml @@ -24,6 +24,7 @@ when: proxy_env is defined and proxy_env # can't update grub in chroot/docker - enable_hugepages_on_boot + - enable_iommu_on_boot # needed for collectd plugins - increase_open_file_limits - install_image_dependencies @@ -54,3 +55,5 @@ - install_pmu_tools - download_collectd - install_collectd + - docker + - barometer_collectd |