diff options
Diffstat (limited to 'ansible/roles')
18 files changed, 152 insertions, 119 deletions
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/build_yardstick_image/tasks/cloudimg_modify_nsb.yml b/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml index 9a70ff39a..c9e386346 100644 --- a/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml +++ b/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml @@ -52,14 +52,21 @@ - install_image_dependencies - enable_hugepages_on_boot # can't update grub in chroot/docker - increase_open_file_limits # needed for collectd plugins - - download_dpdk - - install_dpdk - download_trex - install_trex - - download_pktgen - - install_pktgen - download_civetweb - install_civetweb + loop_control: + loop_var: role_item + environment: "{{ proxy_env }}" + +- include_role: + name: "{{ role_item }}" + vars: + dpdk_version: "{{ dpdk_version_for_PROX }}" + with_items: + - download_dpdk + - install_dpdk - download_samplevnfs loop_control: loop_var: role_item @@ -68,6 +75,23 @@ - include_vars: roles/install_dpdk/defaults/main.yml when: INSTALL_BIN_PATH is undefined +- name: Install PROX + include_role: + name: install_samplevnf + vars: + vnf_name: PROX + +- include_role: + name: "{{ role_item }}" + with_items: + - download_dpdk + - install_dpdk + - download_pktgen + - install_pktgen + loop_control: + loop_var: role_item + environment: "{{ proxy_env }}" + - include_vars: roles/download_samplevnfs/defaults/main.yml when: samplevnf_dest is undefined - set_fact: @@ -75,7 +99,6 @@ - include_role: name: install_samplevnf with_items: - - PROX - UDP_Replay - ACL - FW 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/download_dpdk/defaults/main.yml b/ansible/roles/download_dpdk/defaults/main.yml index 83711881b..b2d959eed 100644 --- a/ansible/roles/download_dpdk/defaults/main.yml +++ b/ansible/roles/download_dpdk/defaults/main.yml @@ -1,11 +1,11 @@ --- dpdk_version: "17.05" +dpdk_version_for_PROX: "18.11" dpdk_url: "http://fast.dpdk.org/rel/dpdk-{{ dpdk_version }}.tar.xz" dpdk_file: "{{ dpdk_url|basename }}" dpdk_unarchive: "{{ dpdk_file|regex_replace('[.]tar[.]xz$', '') }}" dpdk_dest: "{{ clone_dest }}/" -#NOTE(ralonsoh): DPDK > 17.02 are currently unsupported due to prox build issues dpdk_md5: "16.07.2": "md5:4922ea2ec935b64ff5c191fec53344a6" "16.11.7": "md5:c081d113dfd57633e3bc3ebc802691be" @@ -16,3 +16,4 @@ dpdk_md5: "17.11.3": "md5:68ca84ac878011acf44e75d33b46f55b" #unsupported "18.02.2": "md5:75ad6d39b513649744e49c9fcbbb9ca5" #unsupported "18.05": "md5:9fc86367cd9407ff6a8dfea56c4eddc4" #unsupported + "18.11": "md5:04b86f4a77f4f81a7fbd26467dd2ea9f" # Not supported by SampleVNFs except PROX 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/download_samplevnfs/defaults/main.yml b/ansible/roles/download_samplevnfs/defaults/main.yml index 104f594f5..5ddc9f0f9 100644 --- a/ansible/roles/download_samplevnfs/defaults/main.yml +++ b/ansible/roles/download_samplevnfs/defaults/main.yml @@ -13,4 +13,4 @@ samplevnf_url: "https://git.opnfv.org/samplevnf" samplevnf_dest: "{{ clone_dest }}/samplevnf" -samplevnf_version: "3afd384b7e68a3cd29f4d2cdf39785f8441d0b6f" +samplevnf_version: "47123bfc1b3c0d0b01884aebbce1a3e09ad7ddb0" diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml index e406fcc1e..188b32915 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/main.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -22,55 +22,57 @@ iommu_boot_params: ' amd_iommu=on iommu=pt' when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD" -- name: Define grub string for IOMMU - set_fact: - enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}' +- 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 {{ 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 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 - lineinfile: - path: "{{ grub_file}}" - regexp: "_iommu=" - line: '{{ iommu_help_string }}' - state: absent - check_mode: yes - 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 -- 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: 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: 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: 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/install_dependencies_jumphost/tasks/Debian.yml b/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml index 9baf7e59e..a229cc1a2 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,31 @@ - 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: Uninstall docker as it conflicts with docker-py + pip: + name: + - docker + state: absent + +- name: Install required docker-py module + pip: + name: + - docker-py + - shade + 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_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml index d1dc2900b..a1a377eb1 100644 --- a/ansible/roles/install_dpdk/tasks/main.yml +++ b/ansible/roles/install_dpdk/tasks/main.yml @@ -20,6 +20,10 @@ # with_fileglob: # - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch" +- debug: + var: dpdk_version + verbosity: 2 + - name: find kernel for image, (including chroot) find_kernel: kernel: "{{ ansible_kernel }}" @@ -106,6 +110,7 @@ src: "{{ dpdk_path }}/{{ dpdk_make_arch }}/kmod/igb_uio.ko" dest: "{{ dpdk_module_dir }}/igb_uio.ko" remote_src: yes + when: dpdk_version is version(dpdk_version_for_PROX, '>=') - name: run depmod for dpdk_kernel command: depmod "{{ dpdk_kernel }}" @@ -114,20 +119,14 @@ path: "{{ INSTALL_BIN_PATH }}" state: directory -- set_fact: - major: "{{ dpdk_version.split('.')[0] }}" - minor: "{{ dpdk_version.split('.')[1] }}" - -- set_fact: - major_minor_version: "{{ major }}.{{ minor }}" - - name: copy dpdk-devbind.py to correct location copy: - src: "{{ dpdk_devbind_usertools if major_minor_version|float >= 17.02 else dpdk_devbind_tools }}" + src: "{{ dpdk_devbind_usertools if dpdk_version is version('17.02', '>=') else dpdk_devbind_tools }}" dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py" remote_src: yes force: yes mode: 0755 + when: dpdk_version is version(dpdk_version_for_PROX, '>=') - name: make vPE binary command: make -j {{ ansible_processor_vcpus }} @@ -135,6 +134,7 @@ chdir: "{{ dpdk_path }}/examples/ip_pipeline" environment: RTE_SDK: "{{ dpdk_path }}" + when: dpdk_version is version(dpdk_version_for_PROX, '!=') - name: Copy vPE to correct location copy: @@ -143,3 +143,4 @@ remote_src: yes force: yes mode: 0755 + when: dpdk_version is version(dpdk_version_for_PROX, '!=') diff --git a/ansible/roles/install_image_dependencies/defaults/main.yml b/ansible/roles/install_image_dependencies/defaults/main.yml index 7a3f5fa7e..42951bf6d 100644 --- a/ansible/roles/install_image_dependencies/defaults/main.yml +++ b/ansible/roles/install_image_dependencies/defaults/main.yml @@ -29,6 +29,7 @@ install_dependencies: - libxft-dev - libxss-dev - expect + - libnuma-dev RedHat: - bc - fio 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" |