summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rw-r--r--ansible/build_yardstick_image.yml126
-rw-r--r--ansible/clean_images.yml1
-rw-r--r--ansible/group_vars/all.yml6
-rw-r--r--ansible/image_uploaders/upload_ubuntu_image.yml2
-rw-r--r--ansible/install_dependencies.yml (renamed from ansible/roles/install_prox/tasks/RedHat.yml)11
-rw-r--r--ansible/library/find_kernel.py93
-rw-r--r--ansible/library/my_make.py1
-rw-r--r--ansible/load_images.yml3
-rw-r--r--ansible/nsb_setup.yml58
-rw-r--r--ansible/post_build_yardstick_image.yml2
-rw-r--r--ansible/roles/add_custom_repos/templates/sources.list.j24
-rw-r--r--ansible/roles/add_custom_repos/vars/main.yml3
-rw-r--r--ansible/roles/convert_openrc/defaults/main.yml1
-rw-r--r--[-rwxr-xr-x]ansible/roles/docker/defaults/main.yml (renamed from ansible/roles/install_prox/tasks/Debian.yml)11
-rw-r--r--ansible/roles/docker/handlers/main.yml (renamed from ansible/roles/install_prox/tasks/main.yml)20
-rw-r--r--ansible/roles/docker/tasks/Debian.yml26
-rw-r--r--ansible/roles/docker/tasks/RedHat.yml20
-rw-r--r--ansible/roles/docker/tasks/main.yml31
-rw-r--r--ansible/roles/docker/templates/RedHat-repos.j27
-rw-r--r--ansible/roles/docker/templates/http-proxy-conf.j22
-rw-r--r--ansible/roles/docker/vars/main.yml20
-rw-r--r--ansible/roles/download_dpdk/tasks/main.yml15
-rw-r--r--ansible/roles/download_prox/defaults/main.yml12
-rw-r--r--ansible/roles/download_samplevnfs/defaults/main.yml8
-rw-r--r--ansible/roles/download_samplevnfs/tasks/main.yml17
-rw-r--r--ansible/roles/download_trex/defaults/main.yml6
-rw-r--r--ansible/roles/download_trex/tasks/main.yml12
-rw-r--r--ansible/roles/enable_hugepages_on_boot/defaults/main.yml3
-rwxr-xr-xansible/roles/enable_hugepages_on_boot/tasks/main.yml6
-rwxr-xr-xansible/roles/install_dependencies/tasks/Debian.yml3
-rw-r--r--ansible/roles/install_dependencies/tasks/RedHat.yml28
-rw-r--r--ansible/roles/install_dpdk/defaults/main.yml2
-rwxr-xr-xansible/roles/install_dpdk/tasks/Debian.yml3
-rw-r--r--ansible/roles/install_dpdk/tasks/RedHat.yml2
-rw-r--r--ansible/roles/install_dpdk/tasks/main.yml21
-rw-r--r--ansible/roles/install_dpdk/vars/main.yml3
-rw-r--r--ansible/roles/install_image_dependencies/defaults/main.yml2
-rw-r--r--ansible/roles/install_image_dependencies/tasks/main.yml6
-rw-r--r--ansible/roles/install_samplevnf/tasks/main.yml55
-rw-r--r--ansible/roles/install_samplevnf/vars/main.yml (renamed from ansible/roles/download_prox/tasks/main.yml)49
-rw-r--r--ansible/roles/install_trex/defaults/main.yml3
-rw-r--r--ansible/roles/install_trex/tasks/main.yml17
-rw-r--r--ansible/roles/install_vnf_vACL/tasks/main.yml41
-rw-r--r--ansible/roles/install_vnf_vACL/vars/main.yml2
-rw-r--r--ansible/roles/install_vnf_vCGNAPT/tasks/main.yml41
-rw-r--r--ansible/roles/install_vnf_vCGNAPT/vars/main.yml2
-rw-r--r--ansible/roles/install_vnf_vFW/tasks/main.yml50
-rw-r--r--ansible/roles/install_vnf_vFW/vars/main.yml2
-rw-r--r--ansible/roles/install_vnf_vPE/tasks/main.yml37
-rw-r--r--ansible/roles/install_vnf_vPE/vars/main.yml2
-rw-r--r--ansible/roles/reset_resolv_conf/tasks/main.yml2
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/Debian.yml35
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/RedHat.yml49
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/main.yml55
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml11
-rw-r--r--ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml (renamed from ansible/ubuntu_server_cloudimg_modify_vpe.yml)33
-rw-r--r--ansible/ubuntu_server_cloudimg_modify.yml2
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_cgnapt.yml41
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_dpdk.yml2
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml (renamed from ansible/ubuntu_server_cloudimg_modify_acl.yml)33
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_vfw.yml41
-rw-r--r--ansible/yardstick-install-inventory.ini4
62 files changed, 599 insertions, 607 deletions
diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml
index 49dc3e2b7..35d9da45e 100644
--- a/ansible/build_yardstick_image.yml
+++ b/ansible/build_yardstick_image.yml
@@ -28,19 +28,24 @@
sha256sums_filename: "{{ sha256sums_path|basename }}"
sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}"
- mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}"
workspace: "{{ lookup('env', 'workspace')|default('/tmp/workspace/yardstick', true) }}"
imgfile: "{{ workspace }}/yardstick-image.img"
raw_imgfile_basename: "yardstick-{{ release }}-server.raw"
- raw_imgfile: "{{ workspace }}/{{ raw_imgfile_basename }}"
environment:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
+
tasks:
- group_by:
key: image_builder
- package: name=parted state=present
+ - set_fact:
+ mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}"
+
+ - set_fact:
+ raw_imgfile: "{{ workspace }}/{{ raw_imgfile_basename }}"
+
# cleanup non-lxd
- name: unmount all old mount points
mount:
@@ -68,7 +73,6 @@
state: absent
# download-common
-
- name: remove {{ workspace }}
file:
path: "{{ workspace }}"
@@ -80,61 +84,14 @@
sha256url: "{{ sha256sums_url }}"
dest: "{{ image_dest }}"
-# - get_url:
-# url: "{{ sha256sums_url }}"
-# force: yes
-# dest: "{{ workspace }}/{{ sha256sums_filename }}"
-
- # must use wget to workaround ubuntu cloud SSL certs checking failures
-# - command: "curl -sS -o {{ workspace }}/{{ sha256sums_filename }} {{ sha256sums_url }}"
-
-
-# - command: cat "{{ workspace }}/{{ sha256sums_filename }}"
-# register: sha256sum_file
-#
-# - set_fact:
-# image_sha256: "{{ sha256sum_file.stdout|regex_search('^([a-f0-9]+).*' ~ img ~ '$', '\\1', multiline=True) }}"
-
-# - get_url:
-# url: "{{ image_url }}"
-# force: yes
-# dest: "{{ workspace }}/{{ image_filename }}"
-# checksum: "sha256:{{ image_sha256 }}"
-# register: fetch_image_status
-# timeout: 300
-# retries: 2
-# until: fetch_image_status|succeeded
-
-# - name: "Fetch {{ image_url }}"
-# - command: "curl -sS -o {{ workspace }}/{{ image_filename }} {{ image_url }}"
-# register: fetch_image_status
-# timeout: 300
-# retries: 2
-# until: fetch_image_status|succeeded
-
-# - name: Verify sha256sum of downloaded image
-# - command: "sha256sum -c --ignore-missing {{ workspace }}/{{ sha256sums_filename }}"
-
-# - name: create loop devices
-# command: "mknod -m 660 /dev/loop{{ item }} b 7 {{ item }}"
-# args:
-# creates: "/dev/loop{{ item }}"
-# with_seq:
-# -
-
- # download non-lxd
-
- name: convert image to raw
command: "qemu-img convert {{ image_dest }} {{ raw_imgfile }}"
+ - name: resize image to allow for more VNFs
+ command: "qemu-img resize -f raw {{ raw_imgfile }} +2G"
- # setup non-lxd
-
-# - shell: echo -e "d\\nn\\np\\n1\\n\\n\\nw" | parted -l "{{ raw_imgfile }}"
-# - parted:
-# device: "{{ raw_imgfile }}"
-# number: 1
-# state: present
+ - name: resize parition to allow for more VNFs
+ command: "parted -s -a optimal {{ raw_imgfile }} resizepart 1 100%"
- name: create mknod devices in chroot
command: "mknod -m 0660 /dev/loop{{ item }} b 7 {{ item }}"
@@ -143,23 +100,6 @@
with_sequence: start=0 end=9
tags: mknod_devices
-# - command: losetup --show --partscan --find "{{ raw_imgfile }}"
-# register: loop_device_res
-#
-# - debug:
-# var: loop_device_res
-# verbosity: 2
-#
-# - set_fact:
-# loop_device: "{{ loop_device_res.stdout.strip() }}"
-#
-# - wait_for:
-# path: "{{ loop_device }}"
-# state: present
-#
-# - command: losetup
-# - command: dmsetup ls
-
- name: find first partition device
# command: kpartx -l "{{ loop_device }}"
command: kpartx -l "{{ raw_imgfile }}"
@@ -174,11 +114,9 @@
- name: use kpartx to create device nodes for the raw image loop device
# operate on the loop device to avoid /dev namespace missing devices
-# command: kpartx -avs "{{ loop_device }}"
command: kpartx -avs "{{ raw_imgfile }}"
- name: parted dump raw image
-# command: parted "{{ loop_device }}" print
command: parted "{{ raw_imgfile }}" print
register: parted_res
@@ -192,9 +130,21 @@
- set_fact:
image_fs_type: "{{ blkid_res.stdout.strip() }}"
+ - fail:
+ msg: "We only support ext4 image filesystems because we have to resize"
+ when: image_fs_type != "ext4"
+
+ - name: fsck the image filesystem
+ command: "e2fsck -y -f {{ image_first_partition_device }}"
+
+ - name: resize filesystem to full partition size
+ command: resize2fs {{ image_first_partition_device }}
+
+ - name: fsck the image filesystem
+ command: "e2fsck -y -f {{ image_first_partition_device }}"
- name: make tmp disposable fstab
- command: mktemp fake_fstab.XXXXXXXXXX
+ command: mktemp --tmpdir fake_fstab.XXXXXXXXXX
register: mktemp_res
- set_fact:
@@ -206,7 +156,9 @@
name: "{{ mountdir }}"
# fstype is required
fstype: "{{ image_fs_type }}"
- #fstab: "{{ fake_fstab }}"
+ # !!!!!!! this is required otherwise we add entries to /etc/fstab
+ # and prevent the system from booting
+ fstab: "{{ fake_fstab }}"
state: mounted
- name: mount chroot /proc
@@ -214,7 +166,9 @@
src: none
name: "{{ mountdir }}/proc"
fstype: proc
- #fstab: "{{ fake_fstab }}"
+ # !!!!!!! this is required otherwise we add entries to /etc/fstab
+ # and prevent the system from booting
+ fstab: "{{ fake_fstab }}"
state: mounted
- name: if arm copy qemu-aarch64-static into chroot
@@ -223,19 +177,6 @@
dest: "{{ mountdir }}/usr/bin"
when: 'YARD_IMG_ARCH == "arm64"'
-
- # setup lxd
-# - file: "path={{ mountdir }} state=directory"
-#
-# - unarchive:
-# src: "{{ image_filename }}"
-# dest: "{{ mountdir }}"
-# remote_src: yes
-
- # end setup lxd
-
- # modify
-
- name: create ubuntu policy-rc.d workaround
copy:
content: "{{ '#!/bin/sh\nexit 101\n' }}"
@@ -259,9 +200,16 @@
ansible_python_interpreter: /usr/bin/python3
# set this host variable here
nameserver_ip: "{{ ansible_dns.nameservers[0] }}"
+ image_type: vm
- name: include {{ img_modify_playbook }}
include: "{{ img_modify_playbook }}"
- name: run post build tasks
include: post_build_yardstick_image.yml
+
+- hosts: localhost
+
+ tasks:
+ - debug:
+ msg: "yardstick image = {{ raw_imgfile }}"
diff --git a/ansible/clean_images.yml b/ansible/clean_images.yml
index a7a6c2af1..f63489d2d 100644
--- a/ansible/clean_images.yml
+++ b/ansible/clean_images.yml
@@ -18,5 +18,6 @@
- yardstick_config.yml
roles:
+ - convert_openrc
- clean_images
- clean_flavors
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
new file mode 100644
index 000000000..edd6564d0
--- /dev/null
+++ b/ansible/group_vars/all.yml
@@ -0,0 +1,6 @@
+---
+clone_dest: /opt/tempT
+release: xenial
+target_os: Ubuntu
+ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
+proxy_env: {} \ No newline at end of file
diff --git a/ansible/image_uploaders/upload_ubuntu_image.yml b/ansible/image_uploaders/upload_ubuntu_image.yml
index dcfe6480c..1cf7d0a32 100644
--- a/ansible/image_uploaders/upload_ubuntu_image.yml
+++ b/ansible/image_uploaders/upload_ubuntu_image.yml
@@ -21,7 +21,7 @@
when: fdio
- os_image:
- name: "{{ ubuntu_image }}"
+ name: "{{ ubuntu_image_file | basename }}"
is_public: yes
disk_format: qcow2
container_format: bare
diff --git a/ansible/roles/install_prox/tasks/RedHat.yml b/ansible/install_dependencies.yml
index 69fa83b31..1c7d20170 100644
--- a/ansible/roles/install_prox/tasks/RedHat.yml
+++ b/ansible/install_dependencies.yml
@@ -12,11 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- name: Install PROX build dependencies
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items:
- - pkgconfig
- - lua-devel
- - ncurses-devel
- - libedit-devel
+- name: install yardstick dependencies
+ hosts: all
+ roles:
+ - install_dependencies
diff --git a/ansible/library/find_kernel.py b/ansible/library/find_kernel.py
new file mode 100644
index 000000000..4623bce89
--- /dev/null
+++ b/ansible/library/find_kernel.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+# Copyright (c) 2017 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.
+
+import os
+
+DOCUMENTATION = '''
+---
+module: find_kernel
+short_description: Look for the system kernel on the filesystem
+description:
+ - We need to find the kernel on non-booted systems, disk images, chroots, etc.
+ To do this we check /lib/modules and look for the kernel that matches the running
+ kernle, or failing that we look for the highest-numbered kernel
+options:
+ kernel: starting kernel to check
+ module_dir: Override kernel module dir, default /lib/modules
+'''
+
+LIB_MODULES = "/lib/modules"
+
+
+def try_int(s, *args):
+ """Convert to integer if possible."""
+ try:
+ return int(s)
+ except (TypeError, ValueError):
+ return args[0] if args else s
+
+
+def convert_ints(fields, orig):
+ return tuple((try_int(f) for f in fields)), orig
+
+
+def main():
+ module = AnsibleModule(
+ argument_spec={
+ 'kernel': {'required': True, 'type': 'str'},
+ 'module_dir': {'required': False, 'type': 'str', 'default': LIB_MODULES},
+ }
+ )
+ params = module.params
+ kernel = params['kernel']
+ module_dir = params['module_dir']
+
+ if os.path.isdir(os.path.join(module_dir, kernel)):
+ module.exit_json(changed=False, kernel=kernel)
+
+ kernel_dirs = os.listdir(module_dir)
+ kernels = sorted((convert_ints(re.split('[-.]', k), k) for k in kernel_dirs), reverse=True)
+ try:
+ newest_kernel = kernels[0][-1]
+ except IndexError:
+ module.fail_json(msg="Unable to find kernels in {}".format(module_dir))
+
+ if os.path.isdir(os.path.join(module_dir, newest_kernel)):
+ module.exit_json(changed=False, kernel=newest_kernel)
+ else:
+ return kernel
+
+ module.fail_json(msg="Unable to kernel other than {}".format(kernel))
+
+
+# <<INCLUDE_ANSIBLE_MODULE_COMMON>>
+from ansible.module_utils.basic import * # noqa
+
+if __name__ == '__main__':
+ main()
+
+"""
+
+get kernel from uname, ansible_kernel
+look for that kernel in /lib/modules
+if that kernel doens't exist
+sort lib/modules
+use latest
+
+parse grub
+
+
+
+"""
diff --git a/ansible/library/my_make.py b/ansible/library/my_make.py
index a88053bcc..35240851c 100644
--- a/ansible/library/my_make.py
+++ b/ansible/library/my_make.py
@@ -135,4 +135,3 @@ from ansible.module_utils.basic import *
if __name__ == '__main__':
main()
-
diff --git a/ansible/load_images.yml b/ansible/load_images.yml
index 7cf34adec..a4c130d46 100644
--- a/ansible/load_images.yml
+++ b/ansible/load_images.yml
@@ -59,8 +59,7 @@
- include: build_yardstick_image.yml
-# TEMP
-#- include: image_uploaders/upload_yardstick_image.yml
+- include: image_uploaders/upload_yardstick_image.yml
# upload cirros
# upload vanilla ubuntu cloud_image
diff --git a/ansible/nsb_setup.yml b/ansible/nsb_setup.yml
new file mode 100644
index 000000000..fcb518899
--- /dev/null
+++ b/ansible/nsb_setup.yml
@@ -0,0 +1,58 @@
+# Copyright (c) 2017 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.
+---
+- include: ubuntu_server_baremetal_deploy_samplevnfs.yml
+ vars:
+ YARD_IMG_ARCH: amd64
+
+- hosts: localhost
+ roles:
+ - install_dependencies
+ - docker
+
+- include: build_yardstick_image.yml
+ vars:
+ YARD_IMG_ARCH: amd64
+ release: xenial
+ when: openrc_file is defined
+
+- include: clean_images.yml
+ when: openrc_file is defined
+
+- hosts: localhost
+ post_tasks:
+ - os_image:
+ name: yardstick-samplevnfs
+ is_public: yes
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ raw_imgfile }}"
+ environment: "{{ openrc }}"
+ when: openrc_file is defined
+
+ - name: Start yardstick container
+ docker_container:
+ name: yardstick
+ pull: yes
+ recreate: yes
+ image: opnfv/yardstick:latest
+ recreate: yes
+ state: started
+ restart_policy: always
+ privileged: yes
+ interactive: yes
+ volumes:
+ - "{{ openrc_file|default('/dev/null') }}:/etc/yardstick/openstack.creds:ro"
+ - /var/run/docker.sock:/var/run/docker.sock
+ - /opt/:/opt
diff --git a/ansible/post_build_yardstick_image.yml b/ansible/post_build_yardstick_image.yml
index b0c418721..d1f2a73a8 100644
--- a/ansible/post_build_yardstick_image.yml
+++ b/ansible/post_build_yardstick_image.yml
@@ -40,5 +40,3 @@
- name: kpartx -dv to delete all image partition device nodes
command: kpartx -dv "{{ raw_imgfile }}"
ignore_errors: true
-
- - command: losetup -d "{{ loop_device }}" \ No newline at end of file
diff --git a/ansible/roles/add_custom_repos/templates/sources.list.j2 b/ansible/roles/add_custom_repos/templates/sources.list.j2
index 86be348f6..af741cb10 100644
--- a/ansible/roles/add_custom_repos/templates/sources.list.j2
+++ b/ansible/roles/add_custom_repos/templates/sources.list.j2
@@ -1,5 +1,5 @@
{% if YARD_IMG_ARCH == "arm64" %}
-deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ ubuntu_release[target_os_version] }}-backports main restricted universe multiverse
+deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ release }}-backports main restricted universe multiverse
{% else %}
-deb http://archive.ubuntu.com/ubuntu/ {{ ubuntu_release[target_os_version] }}-backports main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu/ {{ release }}-backports main restricted universe multiverse
{% endif %}
diff --git a/ansible/roles/add_custom_repos/vars/main.yml b/ansible/roles/add_custom_repos/vars/main.yml
deleted file mode 100644
index 03ed6e446..000000000
--- a/ansible/roles/add_custom_repos/vars/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-ubuntu_release:
- "16.04": xenial
- "14.04": trusty \ No newline at end of file
diff --git a/ansible/roles/convert_openrc/defaults/main.yml b/ansible/roles/convert_openrc/defaults/main.yml
index dffca1078..24a7129cc 100644
--- a/ansible/roles/convert_openrc/defaults/main.yml
+++ b/ansible/roles/convert_openrc/defaults/main.yml
@@ -12,6 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-openrc_file: "openrc"
cloud_yaml_path: "{{ playbook_dir }}/clouds.yaml"
diff --git a/ansible/roles/install_prox/tasks/Debian.yml b/ansible/roles/docker/defaults/main.yml
index 00a31fc41..e961969a4 100755..100644
--- a/ansible/roles/install_prox/tasks/Debian.yml
+++ b/ansible/roles/docker/defaults/main.yml
@@ -12,13 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- name: Install PROX build dependencies
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items:
- - pkg-config
- - liblua5.2-dev
- - libncurses5
- - libncurses5-dev
- - libncursesw5
- - libncursesw5-dev
- - libedit-dev
+ubuntu_docker_url: https://apt.dockerproject.org/repo
diff --git a/ansible/roles/install_prox/tasks/main.yml b/ansible/roles/docker/handlers/main.yml
index 93025fcb4..5e6556031 100644
--- a/ansible/roles/install_prox/tasks/main.yml
+++ b/ansible/roles/docker/handlers/main.yml
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Intel Corporation
+# Copyright (c) 2017 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,19 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- include: "{{ ansible_os_family }}.yml"
-
-- name: workaround, make trailing.sh executable
- file:
- path: "{{ prox_path }}/helper-scripts/trailing.sh"
- state: touch
- mode: 0755
- when: prox_version == "v035"
-
-- make:
- chdir: "{{ prox_path }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
+ - name: systemd daemon reload
+ command: systemctl daemon-reload
+ - name: restart docker
+ service: name=docker state=restarted
diff --git a/ansible/roles/docker/tasks/Debian.yml b/ansible/roles/docker/tasks/Debian.yml
new file mode 100644
index 000000000..cf4128774
--- /dev/null
+++ b/ansible/roles/docker/tasks/Debian.yml
@@ -0,0 +1,26 @@
+# Copyright (c) 2017 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: add Ubuntu docker repo
+ apt_repository: repo='deb [trusted=yes] {{ ubuntu_docker_url }} ubuntu-{{ ansible_distribution_release }} main' state=present
+
+ - name: ensure correct docker version
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: "{{ docker_packages[ansible_os_family] }}"
+
+ - name: remove Ubuntu docker repo
+ apt_repository:
+ repo: 'deb [trusted=yes] {{ ubuntu_docker_url }} ubuntu-{{ ansible_distribution_release }} main'
+ state: absent
+ update_cache: no
diff --git a/ansible/roles/docker/tasks/RedHat.yml b/ansible/roles/docker/tasks/RedHat.yml
new file mode 100644
index 000000000..2261da3de
--- /dev/null
+++ b/ansible/roles/docker/tasks/RedHat.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 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: bootstrap docker project repos
+ template: "src={{ ansible_os_family }}-repos.j2 dest=/etc/yum.repos.d/docker.repo"
+
+ - name: ensure correct docker version
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ docker_packages[ansible_os_family] }}"
diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml
new file mode 100644
index 000000000..bbec371a8
--- /dev/null
+++ b/ansible/roles/docker/tasks/main.yml
@@ -0,0 +1,31 @@
+# Copyright (c) 2017 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: Install docker
+ include: "{{ ansible_os_family }}.yml"
+
+ - name: create docker service config dir
+ file: path=/etc/systemd/system/docker.service.d state=directory
+
+ - name: create docker proxy config
+ template: src=http-proxy-conf.j2 dest=/etc/systemd/system/docker.service.d/http-proxy.conf owner=root mode=0644
+ when: 'proxy_env is defined and "http_proxy" in proxy_env or "https_proxy" in proxy_env'
+ notify:
+ - systemd daemon reload
+ - restart docker
+
+ - name: start docker service
+ service: name=docker state=started enabled=yes
+
+ - meta: flush_handlers
diff --git a/ansible/roles/docker/templates/RedHat-repos.j2 b/ansible/roles/docker/templates/RedHat-repos.j2
new file mode 100644
index 000000000..6d367408c
--- /dev/null
+++ b/ansible/roles/docker/templates/RedHat-repos.j2
@@ -0,0 +1,7 @@
+[dockerrepo]
+name=Docker Repository
+# $releasever for RHEL 7 is '7Server' so we can't use $releasever
+baseurl={{ docker_project_url }}/repo/main/{{ ansible_distribution|lower|regex_replace('redhat', 'centos') }}/{{ ansible_distribution_major_version }}/
+enabled=1
+gpgcheck=1
+gpgkey={{ docker_project_url }}/gpg
diff --git a/ansible/roles/docker/templates/http-proxy-conf.j2 b/ansible/roles/docker/templates/http-proxy-conf.j2
new file mode 100644
index 000000000..854ddfe09
--- /dev/null
+++ b/ansible/roles/docker/templates/http-proxy-conf.j2
@@ -0,0 +1,2 @@
+[Service]
+Environment={% if "http_proxy" in proxy_env %}"HTTP_PROXY={{ proxy_env.http_proxy }}" {% endif %} {% if "https_proxy" in proxy_env %} "HTTPS_PROXY={{ proxy_env.https_proxy }}" {% endif %} {% if "http_proxy" in proxy_env or "https_proxy" in proxy_env %} "NO_PROXY=localhost,127.0.0.0/8" {% endif %}
diff --git a/ansible/roles/docker/vars/main.yml b/ansible/roles/docker/vars/main.yml
new file mode 100644
index 000000000..8b5077490
--- /dev/null
+++ b/ansible/roles/docker/vars/main.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 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.
+---
+docker_project_url: https://yum.dockerproject.org
+docker_packages:
+ "RedHat":
+ - docker-engine-1.13.1
+ "Debian":
+ - docker-engine=1.13.1*
diff --git a/ansible/roles/download_dpdk/tasks/main.yml b/ansible/roles/download_dpdk/tasks/main.yml
index 322f3cd0c..bcb5dde1a 100644
--- a/ansible/roles/download_dpdk/tasks/main.yml
+++ b/ansible/roles/download_dpdk/tasks/main.yml
@@ -16,6 +16,10 @@
var: dpdk_version
verbosity: 2
+- file:
+ path: "{{ dpdk_dest }}"
+ state: directory
+
- name: fetch dpdk
get_url:
url: "{{ dpdk_url }}"
@@ -24,12 +28,17 @@
checksum: "{{ dpdk_sha256s[dpdk_version] }}"
- unarchive:
- src: "{{ clone_dest }}/{{ dpdk_file }}"
- dest: "{{ clone_dest }}/"
+ src: "{{ dpdk_dest }}/{{ dpdk_file }}"
+ dest: "{{ dpdk_dest }}/"
copy: no
+- name: cleanup tar file to save space
+ file:
+ path: "{{ dpdk_dest }}/{{ dpdk_file }}"
+ state: absent
+
- set_fact:
- dpdk_path: "{{ clone_dest }}/{{ dpdk_unarchive }}"
+ dpdk_path: "{{ dpdk_dest }}/{{ dpdk_unarchive }}"
- set_fact:
RTE_SDK: "{{ dpdk_path }}"
diff --git a/ansible/roles/download_prox/defaults/main.yml b/ansible/roles/download_prox/defaults/main.yml
deleted file mode 100644
index 797db3125..000000000
--- a/ansible/roles/download_prox/defaults/main.yml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-prox_version: v037
-prox_suffix:
- v035: "zip"
- v037: "tar.gz"
-prox_url: "https://01.org/sites/default/files/downloads/intelr-data-plane-performance-demonstrators/dppd-prox-{{ prox_version }}.{{ prox_suffix[prox_version] }}"
-prox_file: "{{ prox_url|basename }}"
-prox_unarchive: "{{ prox_file|regex_replace('[.]zip$', '')|regex_replace('-prox-', '-PROX-') }}"
-prox_dest: "{{ clone_dest }}/"
-prox_sha256s:
- v035: "sha256:f5d3f7c3855ca198d2babbc7045ed4373f0ddc13dc243fedbe23ed395ce65cc9"
- v037: "sha256:a12d021fbc0f5ae55ab55a2bbf8f3b260705ce3e61866288f023ccabca010bca"
diff --git a/ansible/roles/download_samplevnfs/defaults/main.yml b/ansible/roles/download_samplevnfs/defaults/main.yml
index 44449af6f..5f565a415 100644
--- a/ansible/roles/download_samplevnfs/defaults/main.yml
+++ b/ansible/roles/download_samplevnfs/defaults/main.yml
@@ -1,6 +1,4 @@
---
-samplevnf_version: ""
-samplevnf_file: "{{ samplevnf_url|basename }}"
-samplevnf_unarchive: "{{ samplevnf_file|regex_replace('[.]tar[.]gz$', '') }}"
-samplevnf_dest: "{{ clone_dest }}/"
-samplevnf_sha256: "sha256:36457cadfd23053c9ce1cf2e6f048cad6a5d04a7371d7a122e133dcbf007989e"
+samplevnf_url: "https://git.opnfv.org/samplevnf"
+samplevnf_dest: "{{ clone_dest }}/samplevnf"
+samplevnf_version: "master"
diff --git a/ansible/roles/download_samplevnfs/tasks/main.yml b/ansible/roles/download_samplevnfs/tasks/main.yml
index 005d57dda..e9d4142c9 100644
--- a/ansible/roles/download_samplevnfs/tasks/main.yml
+++ b/ansible/roles/download_samplevnfs/tasks/main.yml
@@ -17,16 +17,13 @@
# verbosity: 2
- name: fetch samplevnf
- get_url:
- url: "{{ samplevnf_url }}"
+ git:
+ repo: "{{ samplevnf_url }}"
dest: "{{ samplevnf_dest }}"
- validate_certs: False
- checksum: "{{ samplevnf_sha256 }}"
-
-- unarchive:
- src: "{{ clone_dest }}/{{ samplevnf_file }}"
- dest: "{{ clone_dest }}/"
- copy: no
+ version: "{{ samplevnf_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
- set_fact:
- samplevnf_path: "{{ clone_dest }}/{{ samplevnf_unarchive }}"
+ samplevnf_path: "{{ samplevnf_dest }}"
diff --git a/ansible/roles/download_trex/defaults/main.yml b/ansible/roles/download_trex/defaults/main.yml
index dd2dd27eb..6e8fa7020 100644
--- a/ansible/roles/download_trex/defaults/main.yml
+++ b/ansible/roles/download_trex/defaults/main.yml
@@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-trex_version: v2.20
+trex_version: v2.28
trex_url: "https://trex-tgn.cisco.com/trex/release/{{ trex_version }}.tar.gz"
trex_file: "{{ trex_url|basename }}"
trex_unarchive: "{{ trex_file|regex_replace('[.]tar.gz$', '') }}"
trex_dest: "{{ clone_dest }}/"
-trex_sha256: "sha256:eb5a069f758a36133a185c7e27af10834ca03d11441165403529fbd7844658fb"
+trex_sha256s:
+ "v2.20": "sha256:eb5a069f758a36133a185c7e27af10834ca03d11441165403529fbd7844658fb"
+ "v2.28": "sha256:c3f08aabbd69dddb09843984d41acbe9ba1af6a6ef3380a7830f7c9e33134207"
diff --git a/ansible/roles/download_trex/tasks/main.yml b/ansible/roles/download_trex/tasks/main.yml
index 75a3169f0..baa964fd8 100644
--- a/ansible/roles/download_trex/tasks/main.yml
+++ b/ansible/roles/download_trex/tasks/main.yml
@@ -16,10 +16,16 @@
get_url:
url: "{{ trex_url }}"
dest: "{{ trex_dest }}"
- checksum: "{{ trex_sha256 }}"
+ validate_certs: False
+ checksum: "{{ trex_sha256s[trex_version] }}"
- name: unarchive Trex
unarchive:
- src: "{{ clone_dest }}/{{ trex_file }}"
- dest: "{{ clone_dest }}/"
+ src: "{{ trex_dest }}/{{ trex_file }}"
+ dest: "{{ trex_dest }}/"
copy: no
+
+- name: cleanup tar file to save space
+ file:
+ path: "{{ trex_dest }}/{{ trex_file }}"
+ state: absent
diff --git a/ansible/roles/enable_hugepages_on_boot/defaults/main.yml b/ansible/roles/enable_hugepages_on_boot/defaults/main.yml
new file mode 100644
index 000000000..015e01bab
--- /dev/null
+++ b/ansible/roles/enable_hugepages_on_boot/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+num_hugepages: auto
+huge_pagesize_mb: 1024 \ No newline at end of file
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
index f258bb684..6e7657a39 100755
--- a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
@@ -28,7 +28,7 @@
- name: use 16 for auto num_hugepages and 1G size
set_fact:
- num_hugepages: 16
+ num_hugepages: 8
when: num_hugepages|default("auto") == "auto"
- name: set hugepages in grub
@@ -38,15 +38,11 @@
line: '{{ hugepage_param }}'
state: present
-- name: Update grub
- command: "{{ update_grub[ansible_os_family] }}"
-
- name: create hugetables mount
file:
path: "{{ hugetable_mount }}"
state: directory
-
- name: mount hugetlbfs
mount:
name: "{{ hugetable_mount }}"
diff --git a/ansible/roles/install_dependencies/tasks/Debian.yml b/ansible/roles/install_dependencies/tasks/Debian.yml
index ac8332287..bba6fb13c 100755
--- a/ansible/roles/install_dependencies/tasks/Debian.yml
+++ b/ansible/roles/install_dependencies/tasks/Debian.yml
@@ -29,6 +29,7 @@
- qemu-kvm
- qemu-user-static
- qemu-utils
+ - kpartx
- libvirt0
- python-libvirt
- bridge-utils
@@ -46,4 +47,4 @@
- uwsgi-plugin-python
- supervisor
- python-setuptools
-
+ - lsof
diff --git a/ansible/roles/install_dependencies/tasks/RedHat.yml b/ansible/roles/install_dependencies/tasks/RedHat.yml
index 4bb7c318e..a5d4d0b15 100644
--- a/ansible/roles/install_dependencies/tasks/RedHat.yml
+++ b/ansible/roles/install_dependencies/tasks/RedHat.yml
@@ -17,8 +17,6 @@
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux']
- name: Install core packages
- # we need to recompile the kernel, but we don't need libvirtd it will
- # run in a container
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- deltarpm
@@ -30,7 +28,6 @@
- screen
- git
- socat
- #
- sshpass
- qemu-kvm
- qemu-img
@@ -38,7 +35,6 @@
- libxslt-devel
- libffi-devel
- openssl-devel
- - zeromq2-devel
- nginx
- uwsgi
- uwsgi-plugin-python
@@ -46,25 +42,5 @@
- python-setuptools
- libffi-devel
- python-devel
- # don't install kernel-devel here it will trigger unwanted kernel upgrade
- # Mandatory Packages:
- # Don't use yum groups, they don't work, expand them manually
- # CentOS 'Development Tools' group
-# - autoconf
-# - automake
-# - binutils
-# - bison
-# - flex
-# - gcc
-# - gcc-c++
-# - gettext
-# - libtool
-# - make
-# - patch
-# - pkgconfig
-# - redhat-rpm-config
-# - rpm-build
-# - rpm-sign
- # Fedora 'C Development Tools' group
- # don't use ccache, it can get weird for kernel compiles
-# - ccache
+ - kpartx
+
diff --git a/ansible/roles/install_dpdk/defaults/main.yml b/ansible/roles/install_dpdk/defaults/main.yml
new file mode 100644
index 000000000..fe2172401
--- /dev/null
+++ b/ansible/roles/install_dpdk/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+INSTALL_BIN_PATH: "/opt/nsb_bin" \ No newline at end of file
diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml
index 486d40e11..c77e4f96a 100755
--- a/ansible/roles/install_dpdk/tasks/Debian.yml
+++ b/ansible/roles/install_dpdk/tasks/Debian.yml
@@ -17,3 +17,6 @@
with_items:
- libpcap-dev
+- name: Install kernel headers
+ action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
+
diff --git a/ansible/roles/install_dpdk/tasks/RedHat.yml b/ansible/roles/install_dpdk/tasks/RedHat.yml
index af35c9b3e..2fb249eae 100644
--- a/ansible/roles/install_dpdk/tasks/RedHat.yml
+++ b/ansible/roles/install_dpdk/tasks/RedHat.yml
@@ -17,3 +17,5 @@
with_items:
- libpcap-devel
+- name: Install kernel headers
+ action: "{{ ansible_pkg_mgr }} name=kernel-headers-{{ dpdk_kernel }} state=present"
diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml
index fca0e33af..cab093ad5 100644
--- a/ansible/roles/install_dpdk/tasks/main.yml
+++ b/ansible/roles/install_dpdk/tasks/main.yml
@@ -20,8 +20,22 @@
# with_fileglob:
# - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch"
+- name: find kernel for image, (including chroot)
+ find_kernel:
+ kernel: "{{ ansible_kernel }}"
+ register: found_kernel
+
+# Do this before installing kernel headers
+- name: Set dpdk_kernel to be the kernel we found
+ set_fact:
+ dpdk_kernel: "{{ found_kernel.kernel }}"
+
- include: "{{ ansible_os_family }}.yml"
+- name: set RTE_KERNELDIR to point to found kernel
+ set_fact:
+ RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
+
- my_make:
chdir: "{{ dpdk_path }}"
target: config
@@ -29,6 +43,8 @@
T: "{{ dpdk_make_arch }}"
O: "{{ dpdk_make_arch }}"
extra_args: "-j {{ ansible_processor_vcpus }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
- name: enable RTE_PORT_STATS_COLLECT
lineinfile:
@@ -57,6 +73,8 @@
- my_make:
chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
extra_args: "-j {{ ansible_processor_vcpus }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
- file:
path: "{{ dpdk_module_dir}}"
@@ -67,7 +85,8 @@
dest: "{{ dpdk_module_dir }}/igb_uio.ko"
remote_src: yes
-- command: depmod -a
+- name: run depmod for dpdk_kernel
+ command: depmod "{{ dpdk_kernel }}"
- file:
path: "{{ INSTALL_BIN_PATH }}"
diff --git a/ansible/roles/install_dpdk/vars/main.yml b/ansible/roles/install_dpdk/vars/main.yml
index a226045f5..1cc4f1583 100644
--- a/ansible/roles/install_dpdk/vars/main.yml
+++ b/ansible/roles/install_dpdk/vars/main.yml
@@ -1,9 +1,8 @@
---
dpdk_make_arch: x86_64-native-linuxapp-gcc
-dpdk_module_dir: "/lib/modules/{{ ansible_kernel }}/extra"
+dpdk_module_dir: "/lib/modules/{{ dpdk_kernel }}/extra"
hugetable_mount: /mnt/huge
dpdk_devbind:
"16.07": "{{ dpdk_path }}/tools/dpdk-devbind.py"
"17.02": "{{ dpdk_path }}/usertools/dpdk-devbind.py"
"17.04": "{{ dpdk_path }}/usertools/dpdk-devbind.py"
->>>>>>> 1f587bb... DRAFT: yardstick setup ansible, including load_images
diff --git a/ansible/roles/install_image_dependencies/defaults/main.yml b/ansible/roles/install_image_dependencies/defaults/main.yml
index b1695e278..1540806cc 100644
--- a/ansible/roles/install_image_dependencies/defaults/main.yml
+++ b/ansible/roles/install_image_dependencies/defaults/main.yml
@@ -13,9 +13,7 @@ install_dependencies:
- iproute2
- linux-tools-common
- linux-tools-generic
- - lmbench
- make
- - netperf
- patch
- perl
- rt-tests
diff --git a/ansible/roles/install_image_dependencies/tasks/main.yml b/ansible/roles/install_image_dependencies/tasks/main.yml
index 33d99af06..ffd30f33e 100644
--- a/ansible/roles/install_image_dependencies/tasks/main.yml
+++ b/ansible/roles/install_image_dependencies/tasks/main.yml
@@ -13,11 +13,11 @@
# limitations under the License.
---
- name: OS pre-workarounds
- include: "{{ target_os_family }}.yml"
+ include: "{{ ansible_os_family }}.yml"
- name: Install core packages
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest update_cache=yes"
register: pkg_mgr_results
retries: "{{ pkg_mgr_retries }}"
until: pkg_mgr_results|success
- with_items: "{{ install_dependencies[target_os_family] }}"
+ with_items: "{{ install_dependencies[ansible_os_family] }}"
diff --git a/ansible/roles/install_samplevnf/tasks/main.yml b/ansible/roles/install_samplevnf/tasks/main.yml
new file mode 100644
index 000000000..d332c88bc
--- /dev/null
+++ b/ansible/roles/install_samplevnf/tasks/main.yml
@@ -0,0 +1,55 @@
+# Copyright (c) 2017 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.
+---
+- set_fact:
+ vnf_build_dir: "{{ samplevnf_path }}/VNFs/{{ vnf_build_dirs[vnf_name] }}"
+
+- set_fact:
+ vnf_app_name: "{{ vnf_app_names[vnf_name] }}"
+
+- name: Install extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ vnf_build_dependencies.get(vnf_name, {}).get(ansible_os_family, []) }}"
+
+
+- name: set build env vars
+ set_fact:
+ build_env_vars:
+ RTE_SDK: "{{ RTE_SDK }}"
+ RTE_TARGET: "{{ RTE_TARGET }}"
+ VNF_CORE: "{{ samplevnf_path }}"
+
+- name: set soft CRC for PROX when building in VM
+ set_fact:
+ build_env_vars: "{{ build_env_vars|combine({'crc': 'soft'}) }}"
+ when: vnf_name == "PROX" and image_type is defined and image_type == "vm"
+
+- name: "make {{ vnf_name }} clean"
+ my_make: chdir="{{ vnf_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
+ environment: "{{ build_env_vars }}"
+
+- name: "make {{ vnf_name }}"
+ my_make: chdir="{{ vnf_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
+ environment: "{{ build_env_vars }}"
+
+#- command: cp "{{ vnf_build_dir }}/{{ vnf_name }}/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vACL_vnf"
+
+- name: "Install {{ vnf_name }} VNF"
+ copy:
+ src: "{{ vnf_build_dir }}/build/{{ vnf_app_name }}"
+ dest: "{{ INSTALL_BIN_PATH }}/{{ vnf_app_name }}"
+ remote_src: True
+ # make executable
+ mode: 0755
+
diff --git a/ansible/roles/download_prox/tasks/main.yml b/ansible/roles/install_samplevnf/vars/main.yml
index 0614c74fa..6f2c44a84 100644
--- a/ansible/roles/download_prox/tasks/main.yml
+++ b/ansible/roles/install_samplevnf/vars/main.yml
@@ -12,25 +12,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- debug:
- var: prox_version
- verbosity: 2
-
-- name: fetch prox
- get_url:
- url: "{{ prox_url }}"
- dest: "{{ prox_dest }}"
- validate_certs: False
- checksum: "{{ prox_sha256s[prox_version] }}"
-
-- unarchive:
- src: "{{ clone_dest }}/{{ prox_file }}"
- dest: "{{ clone_dest }}/"
- copy: no
-
-- debug:
- var: prox_unarchive
- verbosity: 2
-
-- set_fact:
- prox_path: "{{ clone_dest }}/{{ prox_unarchive }}" \ No newline at end of file
+vnf_build_dependencies:
+ PROX:
+ Debian:
+ - pkg-config
+ - liblua5.2-dev
+ - libncurses5
+ - libncurses5-dev
+ - libncursesw5
+ - libncursesw5-dev
+ - libedit-dev
+ RedHat:
+ - pkgconfig
+ - lua-devel
+ - ncurses-devel
+ - libedit-devel
+vnf_build_dirs:
+ ACL: vACL
+ FW: vFW
+ CGNATP: vCGNAPT
+ UDP_Replay: UDP_Replay
+ PROX: DPPD-PROX
+vnf_app_names:
+ ACL: vACL
+ FW: vFW
+ CGNATP: vCGNAPT
+ UDP_Replay: UDP_Replay
+ PROX: prox
diff --git a/ansible/roles/install_trex/defaults/main.yml b/ansible/roles/install_trex/defaults/main.yml
index 1b2876301..a5555e355 100644
--- a/ansible/roles/install_trex/defaults/main.yml
+++ b/ansible/roles/install_trex/defaults/main.yml
@@ -13,5 +13,6 @@
# limitations under the License.
---
#TREX_DOWNLOAD: "https://trex-tgn.cisco.com/trex/release/v2.05.tar.gz"
-TREX_VERSION: v2.20
+TREX_VERSION: v2.28
TREX_DOWNLOAD: "{{ nsb_mirror_url|ternary(nsb_mirror_url, 'https://trex-tgn.cisco.com/trex/release' }}/{{ TREX_VERSION }}.tar.gz"
+INSTALL_BIN_PATH: "/opt/nsb_bin"
diff --git a/ansible/roles/install_trex/tasks/main.yml b/ansible/roles/install_trex/tasks/main.yml
index 4818a8087..7ba1fc833 100644
--- a/ansible/roles/install_trex/tasks/main.yml
+++ b/ansible/roles/install_trex/tasks/main.yml
@@ -12,17 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- set_fact:
- trex_file: "{{ trex_url|basename|regex_replace('[.]tar.gz', '') }}"
-
- file: path="{{ INSTALL_BIN_PATH }}/trex" state=absent
- file: path="{{ INSTALL_BIN_PATH }}/trex" state=directory
+- command: mv "{{ trex_dest }}/{{ trex_unarchive }}" "{{ INSTALL_BIN_PATH }}/trex/scripts"
+
+# Don't overwrite igb_uio.ko compiled from DPDK
-- command: mv "{{ clone_dest }}/{{ trex_unarchive }}" "{{ INSTALL_BIN_PATH }}/trex/scripts"
+- name: fix stl __init__.py for python module
+ file:
+ path: "{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl/__init__.py"
+ state: touch
-- file: path="{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl/__init__.py" state=touch
+- name: "symlink client to {{ INSTALL_BIN_PATH }}/trex_client"
+ file:
+ src: "{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane"
+ dest: "{{ INSTALL_BIN_PATH }}/trex_client"
+ state: link
# Don't use trex/scripts/dpdk_nic_bind.py use DPDK usertools/dpdk-devbind.py
#- command: cp "{{ INSTALL_BIN_PATH }}/trex/scripts/dpdk_nic_bind.py" "{{ INSTALL_BIN_PATH }}"
diff --git a/ansible/roles/install_vnf_vACL/tasks/main.yml b/ansible/roles/install_vnf_vACL/tasks/main.yml
deleted file mode 100644
index ff2e769f0..000000000
--- a/ansible/roles/install_vnf_vACL/tasks/main.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2017 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: vACL_vnf make clean
- my_make: chdir="{{ acl_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-- name: make vACL VNF
- my_make: chdir="{{ acl_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-#- command: cp "{{ acl_build_dir }}/vACL/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vACL_vnf"
-- name: Install vACL VNF
- copy:
- src: "{{ acl_build_dir }}/build/vACL"
- dest: "{{ INSTALL_BIN_PATH }}/vACL"
- remote_src: True
- # make executable
- mode: 0755
-
-#- command: cp "{{ acl_build_dir }}/vACL/config/full_tm_profile_10G.cfg" "{{ INSTALL_BIN_PATH }}/"
-#- copy:
-# src: "{{ acl_build_dir }}/vACL/config/full_tm_profile_10G.cfg"
-# dest: "{{ INSTALL_BIN_PATH }}/"
diff --git a/ansible/roles/install_vnf_vACL/vars/main.yml b/ansible/roles/install_vnf_vACL/vars/main.yml
deleted file mode 100644
index ee61bf11c..000000000
--- a/ansible/roles/install_vnf_vACL/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-acl_build_dir: "{{ samplevnf_path }}/VNFs/vACL" \ No newline at end of file
diff --git a/ansible/roles/install_vnf_vCGNAPT/tasks/main.yml b/ansible/roles/install_vnf_vCGNAPT/tasks/main.yml
deleted file mode 100644
index 9f8458f6f..000000000
--- a/ansible/roles/install_vnf_vCGNAPT/tasks/main.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2017 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: vCGNAPT_vnf make clean
- my_make: chdir="{{ acl_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-- name: make vCGNAPT VNF
- my_make: chdir="{{ acl_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-#- command: cp "{{ acl_build_dir }}/vCGNAPT/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vCGNAPT_vnf"
-- name: Install vCGNAPT VNF
- copy:
- src: "{{ acl_build_dir }}/build/vCGNAPT"
- dest: "{{ INSTALL_BIN_PATH }}/vCGNAPT"
- remote_src: True
- # make executable
- mode: 0755
-
-#- command: cp "{{ acl_build_dir }}/vCGNAPT/config/full_tm_profile_10G.cfg" "{{ INSTALL_BIN_PATH }}/"
-#- copy:
-# src: "{{ acl_build_dir }}/vCGNAPT/config/full_tm_profile_10G.cfg"
-# dest: "{{ INSTALL_BIN_PATH }}/"
diff --git a/ansible/roles/install_vnf_vCGNAPT/vars/main.yml b/ansible/roles/install_vnf_vCGNAPT/vars/main.yml
deleted file mode 100644
index cca1a89a3..000000000
--- a/ansible/roles/install_vnf_vCGNAPT/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-acl_build_dir: "{{ samplevnf_path }}/VNFs/vCGNAPT" \ No newline at end of file
diff --git a/ansible/roles/install_vnf_vFW/tasks/main.yml b/ansible/roles/install_vnf_vFW/tasks/main.yml
deleted file mode 100644
index cb3df3ed4..000000000
--- a/ansible/roles/install_vnf_vFW/tasks/main.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2017 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: vFW_vnf make clean
- my_make: chdir="{{ vfw_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-#- name: make vFW VNF
-# my_make: chdir="{{ vfw_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
-# environment:
-# RTE_SDK: "{{ RTE_SDK }}"
-# RTE_TARGET: "{{ RTE_TARGET }}"
-# VNF_CORE: "{{ samplevnf_path }}"
-
-- name: make vFW VNF
- command: make chdir="{{ vfw_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}" all
- args:
- chdir: "{{ vfw_build_dir }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
- VNF_CORE: "{{ samplevnf_path }}"
-
-#- command: cp "{{ vfw_build_dir }}/vFW/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vFW_vnf"
-- name: Install vFW VNF
- copy:
- src: "{{ vfw_build_dir }}/build/vFW"
- dest: "{{ INSTALL_BIN_PATH }}/vFW"
- remote_src: True
- # make executable
- mode: 0755
-
-#- command: cp "{{ vfw_build_dir }}/vFW/config/full_tm_profile_10G.cfg" "{{ INSTALL_BIN_PATH }}/"
-#- copy:
-# src: "{{ vfw_build_dir }}/vFW/config/full_tm_profile_10G.cfg"
-# dest: "{{ INSTALL_BIN_PATH }}/"
diff --git a/ansible/roles/install_vnf_vFW/vars/main.yml b/ansible/roles/install_vnf_vFW/vars/main.yml
deleted file mode 100644
index 8a8a39865..000000000
--- a/ansible/roles/install_vnf_vFW/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-vfw_build_dir: "{{ samplevnf_path }}/VNFs/vFW" \ No newline at end of file
diff --git a/ansible/roles/install_vnf_vPE/tasks/main.yml b/ansible/roles/install_vnf_vPE/tasks/main.yml
deleted file mode 100644
index 91d449a41..000000000
--- a/ansible/roles/install_vnf_vPE/tasks/main.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2017 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: vPE_vnf make clean
- my_make: chdir="{{ vpe_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
-
-- name: make vPE VNF
- my_make: chdir="{{ vpe_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
- environment:
- RTE_SDK: "{{ RTE_SDK }}"
- RTE_TARGET: "{{ RTE_TARGET }}"
-
-#- command: cp "{{ vpe_build_dir }}/vPE/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vPE_vnf"
-- name: Install vPE_vnf
- copy:
- src: "{{ vpe_build_dir }}/build/ip_pipeline"
- dest: "{{ INSTALL_BIN_PATH }}/vPE_vnf"
- remote_src: True
-
-#- command: cp "{{ vpe_build_dir }}/vPE/config/full_tm_profile_10G.cfg" "{{ INSTALL_BIN_PATH }}/"
-#- copy:
-# src: "{{ vpe_build_dir }}/vPE/config/full_tm_profile_10G.cfg"
-# dest: "{{ INSTALL_BIN_PATH }}/"
diff --git a/ansible/roles/install_vnf_vPE/vars/main.yml b/ansible/roles/install_vnf_vPE/vars/main.yml
deleted file mode 100644
index fe0a9727f..000000000
--- a/ansible/roles/install_vnf_vPE/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-vpe_build_dir: "{{ dpdk_path }}/examples/ip_pipeline" \ No newline at end of file
diff --git a/ansible/roles/reset_resolv_conf/tasks/main.yml b/ansible/roles/reset_resolv_conf/tasks/main.yml
index 50094f24f..4e6de695d 100644
--- a/ansible/roles/reset_resolv_conf/tasks/main.yml
+++ b/ansible/roles/reset_resolv_conf/tasks/main.yml
@@ -21,7 +21,7 @@
file:
path: "{{ resolv_conf_stat.stat.lnk_source|dirname }}"
state: directory
- mode: 755
+ mode: 0755
- name: Override resolv.conf link source with specific nameserver
template:
diff --git a/ansible/roles/set_package_installer_proxy/tasks/Debian.yml b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
index 11117e5ed..d3891ab18 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
@@ -1,27 +1,16 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# 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
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 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: Create apt.conf.d/ proxy config
template:
@@ -29,7 +18,7 @@
dest: "/etc/apt/apt.conf.d/20proxy"
- name: Test proxy connection
-# async: "{{ connection_timeout }}"
+ async: "{{ connection_timeout }}"
action: "{{ ansible_pkg_mgr }} name=tar state=latest update_cache=yes"
-# poll: 0
+ poll: 0
register: test_proxy_job_id
diff --git a/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml b/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
index 809e43a60..1c3e9fb0f 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
@@ -1,27 +1,16 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# 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
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 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.
---
# must do this before setting yum proxy
- name: find yum/dnf config
@@ -48,10 +37,14 @@
with_items: "{{ packager_conf_stat.results }}"
register: yum_proxy_lines
-# - name: Test proxy connection
-# # try workaround call makecache directly
-# # yum module was failing for some reason
-# async: "{{ connection_timeout }}"
-# command: "{{ ansible_pkg_mgr }} -d2 -y makecache"
-# poll: 0
-# register: test_proxy_job_id
+ - name: yum disable fastest mirrors
+ include: yum_disable_fastestmirrors.yml
+ when: ansible_pkg_mgr == 'yum'
+
+ - name: Test proxy connection
+ # try workaround call makecache directly
+ # yum module was failing for some reason
+ async: "{{ connection_timeout }}"
+ command: "{{ ansible_pkg_mgr }} -d2 -y makecache"
+ poll: 0
+ register: test_proxy_job_id
diff --git a/ansible/roles/set_package_installer_proxy/tasks/main.yml b/ansible/roles/set_package_installer_proxy/tasks/main.yml
index 9838cd489..fea424bf3 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/main.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/main.yml
@@ -1,40 +1,29 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# 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
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 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: Configure package manager proxy
include: "{{ ansible_os_family }}.yml"
-# - async_status: jid={{ test_proxy_job_id.ansible_job_id }}
-# register: test_proxy_result
-# until: test_proxy_result.finished
-# retries: 60
-# delay: 10
-#
-# - debug: var=hostvars[item]['test_proxy_result']
-# with_items: "{{ hostvars }}"
-#
-# - name: Verify proxy test
-# fail: msg="proxy test timeout"
-# when: "{{ test_proxy_result.get('finished', 0) == 0 }}"
+ - async_status: jid={{ test_proxy_job_id.ansible_job_id }}
+ register: test_proxy_result
+ until: test_proxy_result.finished
+ retries: 60
+ delay: 10
+
+ - debug: var=hostvars[item]['test_proxy_result']
+ with_items: "{{ hostvars }}"
+
+ - name: Verify proxy test
+ fail: msg="proxy test timeout"
+ when: "test_proxy_result.get('finished', 0) == 0"
diff --git a/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml b/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml
new file mode 100644
index 000000000..42388bcd9
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml
@@ -0,0 +1,11 @@
+---
+ - name: yum disable fastest mirrors
+ lineinfile:
+ dest: "/etc/yum/pluginconf.d/fastestmirror.conf"
+ regexp: "^enabled=1"
+ line: "enabled=0"
+ ignore_errors: true
+
+ - name: yum clean all
+ command: yum clean all
+
diff --git a/ansible/ubuntu_server_cloudimg_modify_vpe.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml
index f55a30fb9..14bdd7eea 100644
--- a/ansible/ubuntu_server_cloudimg_modify_vpe.yml
+++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml
@@ -12,30 +12,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- hosts: chroot_image
- connection: chroot
+- hosts: all
vars:
clone_dir: /tmp/yardstick-clone
- pre_tasks:
- - debug: msg="chrooted in {{ inventory_hostname }}"
roles:
- - reset_resolv_conf
- add_custom_repos
- role: set_package_installer_proxy
when: proxy_env is defined and proxy_env
- # can update grub in chroot/docker
-# - enable_hugepages_on_boot
- - modify_cloud_config
+# can't update grub in chroot/docker
+ - enable_hugepages_on_boot
- install_image_dependencies
- role: download_dpdk
- dpdk_version: "16.07"
+# dpdk_version: "17.02"
- install_dpdk
- # vPE is part of DPDK so we don't need to copy it
- - install_vnf_vPE
-# - copy_L4Replay
-# - install_L4Replay
-# - copy_trex
-# - install_trex
-
+ - download_trex
+ - install_trex
+ - download_samplevnfs
+ - role: install_samplevnf
+ vnf_name: PROX
+ - role: install_samplevnf
+ vnf_name: UDP_Replay
+ - role: install_samplevnf
+ vnf_name: ACL
+ - role: install_samplevnf
+ vnf_name: FW
+ - role: install_samplevnf
+ vnf_name: CGNATP
diff --git a/ansible/ubuntu_server_cloudimg_modify.yml b/ansible/ubuntu_server_cloudimg_modify.yml
index 950655ec8..099d5803f 100644
--- a/ansible/ubuntu_server_cloudimg_modify.yml
+++ b/ansible/ubuntu_server_cloudimg_modify.yml
@@ -25,6 +25,8 @@
- reset_resolv_conf
- add_custom_repos
- modify_cloud_config
+ - role: set_package_installer_proxy
+ when: proxy_env is defined and proxy_env
- install_image_dependencies
- download_unixbench
- install_unixbench
diff --git a/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml b/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml
deleted file mode 100644
index 3f2a179bb..000000000
--- a/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2017 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.
----
-- hosts: chroot_image
- connection: chroot
- vars:
- clone_dir: /tmp/yardstick-clone
-
- pre_tasks:
- - debug: msg="chrooted in {{ inventory_hostname }}"
-
- roles:
-# - reset_resolv_conf
-# - add_custom_repos
-# - role: set_package_installer_proxy
-# when: proxy_env is defined and proxy_env
- # can update grub in chroot/docker
-# - enable_hugepages_on_boot
-# - modify_cloud_config
-# - install_image_dependencies
-# - role: download_dpdk
-# dpdk_version: "16.07"
-# - install_dpdk
-# - download_samplevnfs
- - install_vnf_vCGNAPT
-# - copy_L4Replay
-# - install_L4Replay
-# - copy_trex
-# - install_trex
-
diff --git a/ansible/ubuntu_server_cloudimg_modify_dpdk.yml b/ansible/ubuntu_server_cloudimg_modify_dpdk.yml
index 2a087ce91..6bbb383d8 100644
--- a/ansible/ubuntu_server_cloudimg_modify_dpdk.yml
+++ b/ansible/ubuntu_server_cloudimg_modify_dpdk.yml
@@ -25,6 +25,8 @@
- add_custom_repos
- enable_hugepages_on_boot
- modify_cloud_config
+ - role: set_package_installer_proxy
+ when: proxy_env is defined and proxy_env
- install_image_dependencies
- download_unixbench
- install_unixbench
diff --git a/ansible/ubuntu_server_cloudimg_modify_acl.yml b/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml
index 98542d7a3..2700b810f 100644
--- a/ansible/ubuntu_server_cloudimg_modify_acl.yml
+++ b/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml
@@ -18,24 +18,35 @@
clone_dir: /tmp/yardstick-clone
pre_tasks:
- - debug: msg="chrooted in {{ inventory_hostname }}"
+ - debug:
+ msg: "chrooted in {{ inventory_hostname }}"
+ - debug:
+ var: proxy_env
+ verbosity: 2
roles:
- reset_resolv_conf
- add_custom_repos
- role: set_package_installer_proxy
when: proxy_env is defined and proxy_env
- # can update grub in chroot/docker
-# - enable_hugepages_on_boot
+# can't update grub in chroot/docker
+ - enable_hugepages_on_boot
- modify_cloud_config
- install_image_dependencies
-# - role: download_dpdk
-# dpdk_version: "16.07"
-# - install_dpdk
-# - download_samplevnfs
-# - install_vnf_vACL
-# - copy_L4Replay
-# - install_L4Replay
- - copy_trex
+ - role: download_dpdk
+# dpdk_version: "17.02"
+ - install_dpdk
+ - download_trex
- install_trex
+ - download_samplevnfs
+ - role: install_samplevnf
+ vnf_name: PROX
+ - role: install_samplevnf
+ vnf_name: UDP_Replay
+ - role: install_samplevnf
+ vnf_name: ACL
+ - role: install_samplevnf
+ vnf_name: FW
+ - role: install_samplevnf
+ vnf_name: CGNATP
diff --git a/ansible/ubuntu_server_cloudimg_modify_vfw.yml b/ansible/ubuntu_server_cloudimg_modify_vfw.yml
deleted file mode 100644
index f8cd3ecdc..000000000
--- a/ansible/ubuntu_server_cloudimg_modify_vfw.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2017 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.
----
-- hosts: chroot_image
- connection: chroot
- vars:
- clone_dir: /tmp/yardstick-clone
-
- pre_tasks:
- - debug: msg="chrooted in {{ inventory_hostname }}"
-
- roles:
-# - reset_resolv_conf
-# - add_custom_repos
-# - role: set_package_installer_proxy
-# when: proxy_env is defined and proxy_env
- # can update grub in chroot/docker
-# - enable_hugepages_on_boot
-# - modify_cloud_config
-# - install_image_dependencies
-# - role: download_dpdk
-# dpdk_version: "16.07"
-# - install_dpdk
-# - download_samplevnfs
- - install_vnf_vFW
-# - copy_L4Replay
-# - install_L4Replay
-# - copy_trex
-# - install_trex
-
diff --git a/ansible/yardstick-install-inventory.ini b/ansible/yardstick-install-inventory.ini
new file mode 100644
index 000000000..e2647b033
--- /dev/null
+++ b/ansible/yardstick-install-inventory.ini
@@ -0,0 +1,4 @@
+# the group of systems on which to install yardstick
+# by default just localhost
+[yardstick]
+localhost ansible_connection=local