summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorMalanik Jan <janx.malanik@intel.com>2017-07-18 12:54:10 -0400
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-08 16:54:05 -0700
commitc7c51d5100e8eba93337c34bd9eb101ec4cf70df (patch)
tree9e4144c2491d14fe3ec80d885875f828d45125f7 /ansible
parent72778951d6b8968f562fb8fefa02a57159ea1b83 (diff)
yardstick setup ansible, including load_images
also update to cirros 0.3.5 added PROX compilation add create_node_pod_yaml role JIRA: YARDSTICK-639 Change-Id: If5999841287a54c7e5c64a7cc487c6394df90424 Signed-off-by: Malanik Jan <janx.malanik@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/ansible.cfg2
-rw-r--r--ansible/build_yardstick_image.yml267
-rw-r--r--ansible/check_openstack.yml23
-rw-r--r--ansible/clean_images.yml22
-rw-r--r--ansible/clone_repos.yml42
-rw-r--r--ansible/create_node_pod_yaml.yml19
-rw-r--r--ansible/exec_tests.yml24
-rw-r--r--ansible/filter_plugins/fuel_lookups.py54
-rw-r--r--ansible/filter_plugins/networks.py38
-rw-r--r--ansible/image_uploaders/upload_cirros_image.yml34
-rw-r--r--ansible/image_uploaders/upload_ubuntu_image.yml34
-rw-r--r--ansible/image_uploaders/upload_yardstick_image.yml57
-rw-r--r--ansible/install_trex_standalone.yml51
-rw-r--r--ansible/install_yardstick.yml22
-rw-r--r--ansible/inventory.ini3
-rw-r--r--ansible/library/fetch_url_and_verify.py80
-rw-r--r--ansible/library/my_make.py138
-rw-r--r--ansible/library/my_os_networks_facts.py144
-rw-r--r--ansible/library/my_os_router_facts.py113
-rw-r--r--ansible/library/os_images_facts.py166
-rw-r--r--ansible/library/os_router_facts.py113
-rw-r--r--ansible/library/os_stack_facts.py83
-rw-r--r--ansible/library/parse_shell_file.py49
-rwxr-xr-xansible/library/parted.py705
-rw-r--r--ansible/library/write_string.py51
-rw-r--r--ansible/list_stacks.yml21
-rw-r--r--ansible/load_images.yml70
-rw-r--r--ansible/post_build_yardstick_image.yml44
-rw-r--r--ansible/prepare_env.yml69
-rw-r--r--ansible/roles/add_custom_repos/tasks/main.yml16
-rw-r--r--ansible/roles/add_custom_repos/tasks/ubuntu.yml29
-rw-r--r--ansible/roles/add_custom_repos/templates/sources.list.j25
-rw-r--r--ansible/roles/add_custom_repos/vars/main.yml3
-rw-r--r--ansible/roles/add_fuel_jumphost/tasks/main.yml20
-rw-r--r--ansible/roles/add_heat_stack_owner_role/tasks/main.yml24
-rw-r--r--ansible/roles/check_external_network/tasks/main.yml21
-rw-r--r--ansible/roles/check_openstack_services/tasks/main.yml25
-rw-r--r--ansible/roles/clean_flavors/tasks/main.yml19
-rw-r--r--ansible/roles/clean_images/tasks/main.yml32
-rw-r--r--ansible/roles/convert_openrc/defaults/main.yml17
-rw-r--r--ansible/roles/convert_openrc/tasks/main.yml55
-rw-r--r--ansible/roles/convert_openrc/templates/clouds.yaml.j29
-rw-r--r--ansible/roles/copy_L4Replay/tasks/main.yml14
-rw-r--r--ansible/roles/create_dockerfile/tasks/main.yml82
-rw-r--r--ansible/roles/create_dockerfile/templates/centos/Dockerfile69
-rw-r--r--ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile82
-rw-r--r--ansible/roles/create_flavors/tasks/main.yml23
-rw-r--r--ansible/roles/create_fuel_pod_yaml/tasks/main.yml37
-rw-r--r--ansible/roles/create_fuel_pod_yaml/templates/fuel_pod.yaml.j233
-rw-r--r--ansible/roles/create_node_pod_yaml/tasks/main.yml19
-rw-r--r--ansible/roles/create_node_pod_yaml/templates/pod.yaml.j222
-rw-r--r--ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py167
-rw-r--r--ansible/roles/create_storperf_admin_rc/tasks/main.yml27
-rw-r--r--ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j27
-rw-r--r--ansible/roles/detect_fuel_arch/tasks/main.yml25
-rw-r--r--ansible/roles/download_cachestat/defaults/main.yml4
-rw-r--r--ansible/roles/download_cachestat/tasks/main.yml21
-rw-r--r--ansible/roles/download_dpdk/defaults/main.yml10
-rw-r--r--ansible/roles/download_dpdk/tasks/main.yml38
-rw-r--r--ansible/roles/download_prox/defaults/main.yml12
-rw-r--r--ansible/roles/download_prox/tasks/main.yml36
-rw-r--r--ansible/roles/download_ramspeed/defaults/main.yml5
-rw-r--r--ansible/roles/download_ramspeed/tasks/main.yml21
-rw-r--r--ansible/roles/download_samplevnfs/defaults/main.yml6
-rw-r--r--ansible/roles/download_samplevnfs/tasks/main.yml32
-rw-r--r--ansible/roles/download_trex/defaults/main.yml20
-rw-r--r--ansible/roles/download_trex/tasks/main.yml25
-rw-r--r--ansible/roles/download_unixbench/defaults/main.yml4
-rw-r--r--ansible/roles/download_unixbench/tasks/main.yml21
-rwxr-xr-xansible/roles/enable_hugepages_on_boot/tasks/main.yml59
-rw-r--r--ansible/roles/enable_hugepages_on_boot/vars/main.yml26
-rw-r--r--ansible/roles/enable_hugepages_runtime/tasks/main.yml32
-rw-r--r--ansible/roles/enable_hugepages_runtime/vars/main.yml6
-rw-r--r--ansible/roles/enable_igb_uio_on_boot/tasks/main.yml18
-rw-r--r--ansible/roles/install_L4Replay/tasks/main.yml9
-rwxr-xr-xansible/roles/install_dependencies/tasks/Debian.yml49
-rw-r--r--ansible/roles/install_dependencies/tasks/RedHat.yml70
-rw-r--r--ansible/roles/install_dependencies/tasks/main.yml15
-rwxr-xr-xansible/roles/install_dpdk/tasks/Debian.yml19
-rw-r--r--ansible/roles/install_dpdk/tasks/RedHat.yml19
-rw-r--r--ansible/roles/install_dpdk/tasks/main.yml90
-rw-r--r--ansible/roles/install_dpdk/vars/main.yml9
-rw-r--r--ansible/roles/install_image_dependencies/defaults/main.yml46
-rw-r--r--ansible/roles/install_image_dependencies/tasks/Debian.yml15
-rw-r--r--ansible/roles/install_image_dependencies/tasks/RedHat.yml16
-rw-r--r--ansible/roles/install_image_dependencies/tasks/main.yml23
-rw-r--r--ansible/roles/install_local_yardstick/tasks/main.yml19
-rwxr-xr-xansible/roles/install_prox/tasks/Debian.yml24
-rw-r--r--ansible/roles/install_prox/tasks/RedHat.yml22
-rw-r--r--ansible/roles/install_prox/tasks/main.yml30
-rw-r--r--ansible/roles/install_ramspeed/tasks/main.yml26
-rw-r--r--ansible/roles/install_storperf/remove_storperf/tasks/main.yml16
-rw-r--r--ansible/roles/install_storperf/tasks/main.yml16
-rw-r--r--ansible/roles/install_trex/defaults/main.yml17
-rw-r--r--ansible/roles/install_trex/tasks/main.yml36
-rw-r--r--ansible/roles/install_unixbench/tasks/main.yml19
-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/load_igb_uio/tasks/main.yml19
-rw-r--r--ansible/roles/load_msr/tasks/main.yml19
-rw-r--r--ansible/roles/modify_cloud_config/files/10_etc_hosts.cfg4
-rw-r--r--ansible/roles/modify_cloud_config/tasks/main.yml18
-rw-r--r--ansible/roles/reset_resolv_conf/tasks/main.yml29
-rw-r--r--ansible/roles/reset_resolv_conf/templates/resolv.conf.j24
-rw-r--r--ansible/roles/set_package_installer_proxy/defaults/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.yml57
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/main.yml40
-rw-r--r--ansible/roles/set_package_installer_proxy/templates/apt_conf.j23
-rw-r--r--ansible/roles/upload_images/tasks/main.yml26
-rw-r--r--ansible/run_yardstick_tests.yml24
-rw-r--r--ansible/ubuntu_server_cloudimg_modify.yml36
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_acl.yml41
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_cgnapt.yml41
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_dpdk.yml36
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_vfw.yml41
-rw-r--r--ansible/ubuntu_server_cloudimg_modify_vpe.yml41
-rw-r--r--ansible/yardstick_config.yml40
-rw-r--r--ansible/yardstick_verify.yml21
125 files changed, 5175 insertions, 0 deletions
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg
index 14c806515..eb5dd263d 100644
--- a/ansible/ansible.cfg
+++ b/ansible/ansible.cfg
@@ -1,2 +1,4 @@
[defaults]
host_key_checking = False
+keep_remote_files = True
+remote_tmp = /tmp/.ansible/tmp
diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml
new file mode 100644
index 000000000..49dc3e2b7
--- /dev/null
+++ b/ansible/build_yardstick_image.yml
@@ -0,0 +1,267 @@
+# 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: localhost
+
+ vars:
+ 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 }}"
+ 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 }}"
+ sha256sums_path: "{{ release }}/current/SHA256SUMS"
+ 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
+
+ # cleanup non-lxd
+ - name: unmount all old mount points
+ mount:
+ name: "{{ item }}"
+ state: unmounted
+ with_items:
+ # order matters
+ - "{{ mountdir }}/proc"
+ - "{{ mountdir }}"
+ - "/mnt/{{ release }}"
+
+ - name: kpartx -dv to delete all image partition device nodes
+ command: kpartx -dv "{{ raw_imgfile }}"
+ ignore_errors: true
+
+ - name: delete {{ raw_imgfile }}
+ file:
+ path: "{{ raw_imgfile }}"
+ state: absent
+
+ # common
+ - name: remove {{ mountdir }}
+ file:
+ path: "{{ mountdir }}"
+ state: absent
+
+ # download-common
+
+ - name: remove {{ workspace }}
+ file:
+ path: "{{ workspace }}"
+ state: directory
+
+ - name: "fetch {{ image_url }} and verify "
+ fetch_url_and_verify:
+ url: "{{ image_url }}"
+ 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 }}"
+
+
+ # 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: create mknod devices in chroot
+ command: "mknod -m 0660 /dev/loop{{ item }} b 7 {{ item }}"
+ args:
+ creates: "/dev/loop{{ item }}"
+ 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 }}"
+ register: kpartx_res
+
+ - set_fact:
+ image_first_partition: "{{ kpartx_res.stdout_lines[0].split()[0] }}"
+
+ - set_fact:
+ # assume / is the first partition
+ image_first_partition_device: "/dev/mapper/{{ image_first_partition }}"
+
+ - 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
+
+ - debug:
+ var: parted_res
+ verbosity: 2
+
+ - name: use blkid to find filesystem type of first partition device
+ command: blkid -o value -s TYPE {{ image_first_partition_device }}
+ register: blkid_res
+
+ - set_fact:
+ image_fs_type: "{{ blkid_res.stdout.strip() }}"
+
+ - name: make tmp disposable fstab
+ command: mktemp fake_fstab.XXXXXXXXXX
+ register: mktemp_res
+
+ - set_fact:
+ fake_fstab: "{{ mktemp_res.stdout.strip() }}"
+
+ - name: mount first parition on image device
+ mount:
+ src: "{{ image_first_partition_device }}"
+ name: "{{ mountdir }}"
+ # fstype is required
+ fstype: "{{ image_fs_type }}"
+ #fstab: "{{ fake_fstab }}"
+ state: mounted
+
+ - name: mount chroot /proc
+ mount:
+ src: none
+ name: "{{ mountdir }}/proc"
+ fstype: proc
+ #fstab: "{{ fake_fstab }}"
+ state: mounted
+
+ - name: if arm copy qemu-aarch64-static into chroot
+ copy:
+ src: /usr/bin/qemu-aarch64-static
+ 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' }}"
+ dest: "{{ mountdir }}/usr/sbin/policy-rc.d"
+ mode: 0755
+ when: "target_os == 'Ubuntu'"
+
+ - name: set img_modify_playbook
+ set_fact:
+ img_modify_playbook: ubuntu_server_cloudimg_modify.yml
+
+ - debug:
+ var: img_modify_playbook
+ verbosity: 2
+
+ - name: add chroot as host
+ add_host:
+ name: "{{ mountdir }}"
+ groups: chroot_image,image_builder
+ connection: chroot
+ ansible_python_interpreter: /usr/bin/python3
+ # set this host variable here
+ nameserver_ip: "{{ ansible_dns.nameservers[0] }}"
+
+- name: include {{ img_modify_playbook }}
+ include: "{{ img_modify_playbook }}"
+
+- name: run post build tasks
+ include: post_build_yardstick_image.yml
diff --git a/ansible/check_openstack.yml b/ansible/check_openstack.yml
new file mode 100644
index 000000000..1a5d75511
--- /dev/null
+++ b/ansible/check_openstack.yml
@@ -0,0 +1,23 @@
+# 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: check openstack connectivity and extenal network
+ hosts: yardstick
+ vars_files:
+ - yardstick_config.yml
+
+ roles:
+ - check_openstack_services
+ - check_external_network
+
diff --git a/ansible/clean_images.yml b/ansible/clean_images.yml
new file mode 100644
index 000000000..a7a6c2af1
--- /dev/null
+++ b/ansible/clean_images.yml
@@ -0,0 +1,22 @@
+# 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: pre-clean openstack enviroment
+ hosts: yardstick
+ vars_files:
+ - yardstick_config.yml
+
+ roles:
+ - clean_images
+ - clean_flavors
diff --git a/ansible/clone_repos.yml b/ansible/clone_repos.yml
new file mode 100644
index 000000000..6f69b6b15
--- /dev/null
+++ b/ansible/clone_repos.yml
@@ -0,0 +1,42 @@
+# 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: yardstick
+ vars:
+ YARDSTICK_REPO: "{{ lookup('env', 'YARDSTICK_REPO')|default('https://gerrit.opnfv.org/gerrit/yardstick', true) }}"
+ YARDSTICK_REPO_DIR: "{{ lookup('env', 'YARDSTICK_REPO_DIR')|default('/home/opnfv/repos/yardstick', true) }}"
+ YARDSTICK_BRANCH: "{{ lookup('env', 'YARDSTICK_BRANCH')|default('master', true) }}"
+ RELENG_REPO: "{{ lookup('env', 'RELENG_REPO')|default('https://gerrit.opnfv.org/gerrit/releng', true) }}"
+ RELENG_REPO_DIR: "{{ lookup('env', 'RELENG_REPO_DIR')|default('/home/opnfv/repos/releng', true) }}"
+ RELENG_BRANCH: "{{ lookup('env', 'RELENG_BRANCH')|default('master', true) }}"
+
+
+ tasks:
+ - name: Updating releng -> "{{ RELENG_BRANCH }}"
+ git:
+ repo: "{{ RELENG_REPO }}"
+ dest: "{{ RELENG_REPO_DIR }}"
+ version: "{{ RELENG_BRANCH }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
+
+ - name: Updating yardstick -> "{{ YARDSTICK_BRANCH }}"
+ git:
+ repo: "{{ YARDSTICK_REPO }}"
+ dest: "{{ YARDSTICK_REPO_DIR }}"
+ version: "{{ YARDSTICK_BRANCH }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
diff --git a/ansible/create_node_pod_yaml.yml b/ansible/create_node_pod_yaml.yml
new file mode 100644
index 000000000..b94a5fdee
--- /dev/null
+++ b/ansible/create_node_pod_yaml.yml
@@ -0,0 +1,19 @@
+# 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.
+---
+# run on localhost
+- hosts: all
+
+ roles:
+ - role: create_node_pod_yaml
diff --git a/ansible/exec_tests.yml b/ansible/exec_tests.yml
new file mode 100644
index 000000000..9e08e2f9c
--- /dev/null
+++ b/ansible/exec_tests.yml
@@ -0,0 +1,24 @@
+# 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: clone_repos.yml
+ tags:
+ - clone_repos
+# really it fetchs all credentials and sets ENV vars
+- include: prepare_env.yml
+ tags:
+ - prepare_env
+- include: yardstick_verify.yml
+ tags:
+ - yardstick_verify
diff --git a/ansible/filter_plugins/fuel_lookups.py b/ansible/filter_plugins/fuel_lookups.py
new file mode 100644
index 000000000..ac52401e8
--- /dev/null
+++ b/ansible/filter_plugins/fuel_lookups.py
@@ -0,0 +1,54 @@
+# 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.
+
+def do_find_fuel_nodes(fuel_nodes):
+ ips = {}
+ for fuel_node in fuel_nodes:
+ if 'controller' in fuel_node['roles']:
+ ips.setdefault("controller_ids", []).append(fuel_node['id'])
+ ips.setdefault("controllers_ips", []).append(fuel_node['ip'])
+ if 'compute' in fuel_node['roles']:
+ ips.setdefault("compute_ids", []).append(fuel_node['id'])
+ ips.setdefault("computes_ips", []).append(fuel_node['ip'])
+ return ips
+
+# def do_find_fuel_nodes(fuel_output):
+# ips = {}
+# for l in fuel_output.splitlines():
+# splits = l.splti()
+# if 'controller' in l:
+# ips["controller_ids"] = splits[0]
+# ips["controllers_ips"] = splits[9]
+# if 'compute' in l:
+# ips["compute_ids"] = splits[0]
+# ips["computes_ips"] = splits[9]
+# return ips
+
+
+class FilterModule(object):
+ def filters(self):
+ return {
+ 'find_fuel_nodes': do_find_fuel_nodes,
+ }
+
+
+SAMPLE = """\
+id | status | name | cluster | ip | mac | roles | pending_roles | online | group_id
+---+--------+------------------+---------+-----------+-------------------+----------------------+---------------+--------+---------
+ 4 | ready | Untitled (9a:b1) | 1 | 10.20.0.6 | 0c:c4:7a:75:9a:b1 | ceph-osd, compute | | 1 | 1
+ 1 | ready | Untitled (9a:ab) | 1 | 10.20.0.4 | 0c:c4:7a:75:9a:ab | ceph-osd, controller | | 1 | 1
+ 5 | ready | Untitled (9a:1b) | 1 | 10.20.0.7 | 0c:c4:7a:75:9a:1b | ceph-osd, compute | | 1 | 1
+ 2 | ready | Untitled (9a:67) | 1 | 10.20.0.3 | 0c:c4:7a:75:9a:67 | controller | | 1 | 1
+ 3 | ready | Untitled (99:d7) | 1 | 10.20.0.5 | 0c:c4:7a:75:99:d7 | controller, mongo | | 1 | 1
+""" \ No newline at end of file
diff --git a/ansible/filter_plugins/networks.py b/ansible/filter_plugins/networks.py
new file mode 100644
index 000000000..a1573951f
--- /dev/null
+++ b/ansible/filter_plugins/networks.py
@@ -0,0 +1,38 @@
+# 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.
+
+
+from urlparse import urlsplit
+
+
+def do_prefix_to_netmask(arg):
+ return '.'.join(str((0xffffffff << (32 - int(arg)) >> i) & 0xff) for i in
+ range(24, -8, -8))
+
+
+def do_netmask_to_prefix(arg):
+ return sum([bin(int(x)).count('1') for x in arg.split('.')])
+
+
+def do_urlsplit(arg):
+ return urlsplit(arg)
+
+
+class FilterModule(object):
+ def filters(self):
+ return {
+ 'prefix_to_netmask': do_prefix_to_netmask,
+ 'netmask_to_prefix': do_netmask_to_prefix,
+ 'urlsplit': do_urlsplit,
+ }
diff --git a/ansible/image_uploaders/upload_cirros_image.yml b/ansible/image_uploaders/upload_cirros_image.yml
new file mode 100644
index 000000000..eba55dbb7
--- /dev/null
+++ b/ansible/image_uploaders/upload_cirros_image.yml
@@ -0,0 +1,34 @@
+# 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: yardstick
+
+ tasks:
+ - set_fact:
+ image_properties:
+ hw_mem_page_size: 'large'
+ when: fdio
+
+ - os_image:
+ name: "{{ cirros_image }}"
+ is_public: yes
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ cirros_image_file }}"
+ properties: "{{ image_properties }}"
+ environment: "{{ openrc }}"
+
+ - os_image_facts:
+ name: "{{ cirros_image }}"
+ environment: "{{ openrc }}"
diff --git a/ansible/image_uploaders/upload_ubuntu_image.yml b/ansible/image_uploaders/upload_ubuntu_image.yml
new file mode 100644
index 000000000..dcfe6480c
--- /dev/null
+++ b/ansible/image_uploaders/upload_ubuntu_image.yml
@@ -0,0 +1,34 @@
+# 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: yardstick
+
+ tasks:
+ - set_fact:
+ image_properties:
+ hw_mem_page_size: 'large'
+ when: fdio
+
+ - os_image:
+ name: "{{ ubuntu_image }}"
+ is_public: yes
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ ubuntu_image_file }}"
+ properties: "{{ image_properties }}"
+ environment: "{{ openrc }}"
+
+ - os_image_facts:
+ name: "{{ ubuntu_image }}"
+ environment: "{{ openrc }}"
diff --git a/ansible/image_uploaders/upload_yardstick_image.yml b/ansible/image_uploaders/upload_yardstick_image.yml
new file mode 100644
index 000000000..9364c52a5
--- /dev/null
+++ b/ansible/image_uploaders/upload_yardstick_image.yml
@@ -0,0 +1,57 @@
+# 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: yardstick
+
+ tasks:
+ - get_url:
+ url: "{{ CLOUD_IMG_URL }}"
+ dest: "{{ CLOUD_IMAGE }}"
+
+ - name: Extra cloud image kernel
+ - unarchive:
+ asdf:
+
+ - os_image:
+ name: yardstick-{{ release }}-kernel
+ is_public: yes
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ CLOUD_KERNEL }}"
+
+ - set_fact:
+ image_properties:
+ kernel_id: "{{ GLANCE_KERNEL_ID }}"
+ os_command_line: "{{ command_line }}"
+
+ - set_fact:
+ image_properties: "{{ image_properties|combine({'hw_mem_page_size': 'large'} }}"
+ when: fdio
+
+ - set_fact:
+ image_properties: "{{ image_properties|combine({'hw_firmware_type': HW_FIRMWARE_TYPE} }}"
+ when: HW_FIRMWARE_TYPE
+
+ - os_image:
+ name: yardstick-image
+ is_public: yes
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ QCOW2_IMAGE }}"
+ properties: "{{ image_properties }}"
+ environment: "{{ openrc }}"
+
+ - os_image_facts:
+ name: yardstick-image
+ environment: "{{ openrc }}"
diff --git a/ansible/install_trex_standalone.yml b/ansible/install_trex_standalone.yml
new file mode 100644
index 000000000..9cf64142b
--- /dev/null
+++ b/ansible/install_trex_standalone.yml
@@ -0,0 +1,51 @@
+# 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: yardstick
+ vars:
+ ansible_python_interpreter: "/usr/bin/env python"
+ # needed for virtualenv
+ NSB_INSTALL_DIR: /root/nsb_install
+ INSTALL_BIN_PATH: /opt/nsb_bin
+ #TREX_DOWNLOAD: "https://trex-tgn.cisco.com/trex/release/v2.05.tar.gz"
+ TREX_VERSION: v2.20
+ TREX_DOWNLOAD: "https://trex-tgn.cisco.com/trex/release/{{ TREX_VERSION }}.tar.gz"
+
+ tasks:
+ - get_url:
+ url: "{{ TREX_DOWNLOAD }}"
+ dest: "{{ NSB_INSTALL_DIR }}"
+ checksum: "sha256:b9620341e552d2ef71d5ffa39ef92f12a1186836c250390db77bd7228497b91c"
+
+ - unarchive:
+ src: "{{ NSB_INSTALL_DIR }}/{{ TREX_DOWNLOAD|basename }}"
+ dest: "{{ NSB_INSTALL_DIR }}"
+ copy: no
+
+ - file: path="{{ INSTALL_BIN_PATH }}/trex" state=absent
+ - file: path="{{ INSTALL_BIN_PATH }}/trex" state=directory
+
+ - command: mv "{{ NSB_INSTALL_DIR }}/{{ TREX_DOWNLOAD|basename|regex_replace('\.tar.gz', '') }}" "{{ INSTALL_BIN_PATH }}/trex/scripts"
+
+ - file: path="{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl/__init__.py" state=touch
+
+ - command: cp "{{ INSTALL_BIN_PATH }}/trex/scripts/dpdk_nic_bind.py" "{{ INSTALL_BIN_PATH }}"
+
+ - name: add scripts to PYTHONPATH
+ lineinfile:
+ dest: /etc/environment
+ regexp: "^PYTHONPATH="
+ line: "PYTHONPATH={{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane:{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl:{{ NSB_INSTALL_DIR }}/yardstick"
+ state: present
+ create: yes
diff --git a/ansible/install_yardstick.yml b/ansible/install_yardstick.yml
new file mode 100644
index 000000000..91d9b280a
--- /dev/null
+++ b/ansible/install_yardstick.yml
@@ -0,0 +1,22 @@
+# 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 yardstick python package
+ hosts: yardstick
+ vars_files:
+ - yardstick_config.yml
+
+ roles:
+ - install_local_yardstick
+
diff --git a/ansible/inventory.ini b/ansible/inventory.ini
index 79a6ee0aa..31692a777 100644
--- a/ansible/inventory.ini
+++ b/ansible/inventory.ini
@@ -1,3 +1,6 @@
+[yardstick]
+localhost ansible_connection=local
+
[controller]
host1 ansible_host=10.1.0.50 ansible_user=root ansible_ssh_pass=root
host2 ansible_host=10.1.0.51 ansible_user=root ansible_ssh_pass=root
diff --git a/ansible/library/fetch_url_and_verify.py b/ansible/library/fetch_url_and_verify.py
new file mode 100644
index 000000000..6c5c0a8c2
--- /dev/null
+++ b/ansible/library/fetch_url_and_verify.py
@@ -0,0 +1,80 @@
+#!/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.
+
+DOCUMENTATION = '''
+---
+module: fetch_url_and_verify
+short_description: Fetch image and verify against a SHA256SUM URL
+description:
+ - Download a URL and check it against a remote SHA256SUMS file
+options:
+ url: Image URL
+ image_dest: Image filename
+ sha256_url: SHA256SUMS URL
+ dest: python file mode (w, wb, a, ab)
+ retries: fetch retries
+'''
+
+
+def main():
+ module = AnsibleModule(
+ argument_spec={
+ 'url': {'required': True, 'type': 'str'},
+ 'sha256url': {'required': True, 'type': 'str'},
+ 'dest': {'required': True, 'type': 'path'},
+ 'retries': {'required': False, 'type': 'int', 'default': 3},
+ }
+ )
+ params = module.params
+ url = params['url']
+ dest = params['dest']
+ sha256url = params['sha256url']
+ retries = params['retries']
+
+ image_dir, image_filename = os.path.split(dest)
+ rc, stdout, stderr = module.run_command(['curl', '-sS', sha256url])
+ if rc == 0 and stdout:
+ sha256line = next(
+ (l for l in stdout.splitlines() if image_filename in l), "")
+ if not sha256line:
+ module.fail_json(
+ msg="Unable to find SHA256SUMS line for file {}".format(
+ image_filename))
+ rc = \
+ module.run_command(['sha256sum', '-c'], data=sha256line, cwd=image_dir)[0]
+ if rc == 0:
+ sha256sum = sha256line.split()[0]
+ module.exit_json(changed=False, dest=dest, url=url,
+ sha256sum=sha256sum)
+
+ for retry in range(retries):
+ curl_rc, stdout, stderr = module.run_command(
+ ['curl', '-sS', '-o', dest, url], cwd=image_dir)
+ if curl_rc == 0:
+ sha256_rc, stdout, stderr = module.run_command(['sha256sum', '-c'],
+ data=sha256line,
+ cwd=image_dir)
+ if sha256_rc == 0:
+ module.exit_json(changed=True)
+
+ module.fail_json(msg="Unable to download {}".format(url), stdout=stdout,
+ stderr=stderr)
+
+
+# <<INCLUDE_ANSIBLE_MODULE_COMMON>>
+from ansible.module_utils.basic import * # noqa
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/my_make.py b/ansible/library/my_make.py
new file mode 100644
index 000000000..a88053bcc
--- /dev/null
+++ b/ansible/library/my_make.py
@@ -0,0 +1,138 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
+#
+# This file is part of Ansible
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import absolute_import
+DOCUMENTATION = '''
+---
+module: my_make
+short_description: Run targets in a Makefile
+requirements: [ make ]
+version_added: "2.1"
+author: Linus Unnebäck (@LinusU) <linus@folkdatorn.se>
+description:
+ - Run targets in a Makefile.
+options:
+ target:
+ description:
+ - The target to run
+ required: false
+ default: none
+ params:
+ description:
+ - Any extra parameters to pass to make
+ required: false
+ default: none
+ extra_args:
+ description:
+ - Any extra options to pass to make
+ required: false
+ default: none
+ chdir:
+ description:
+ - cd into this directory before running make
+ required: true
+'''
+
+EXAMPLES = '''
+# Build the default target
+- make: chdir=/home/ubuntu/cool-project
+
+# Run `install` target as root
+- make: chdir=/home/ubuntu/cool-project target=install
+ become: yes
+
+# Pass in extra arguments to build
+- make:
+ chdir: /home/ubuntu/cool-project
+ target: all
+ params:
+ NUM_THREADS: 4
+ BACKEND: lapack
+'''
+
+# TODO: Disabled the RETURN as it was breaking docs building. Someone needs to
+# fix this
+RETURN = '''# '''
+
+
+def format_params(params):
+ return [k + '=' + str(v) for k, v in params.items()]
+
+
+def push_arguments(cmd, args):
+ if args['extra_args'] is not None:
+ cmd.extend(shlex.split(args['extra_args']))
+ if args['target'] is not None:
+ cmd.append(args['target'])
+ if args['params'] is not None:
+ cmd.extend(format_params(args['params']))
+ return cmd
+
+
+def check_changed(make_path, module, args):
+ cmd = push_arguments([make_path, '--question'], args)
+ rc, _, __ = module.run_command(cmd, check_rc=False, cwd=args['chdir'])
+ return rc != 0
+
+
+def run_make(make_path, module, args):
+ cmd = push_arguments([make_path], args)
+ module.run_command(cmd, check_rc=True, cwd=args['chdir'])
+
+
+def main():
+ module = AnsibleModule(
+ supports_check_mode=True,
+ argument_spec=dict(
+ target=dict(required=False, default=None, type='str'),
+ params=dict(required=False, default=None, type='dict'),
+ extra_args=dict(required=False, default=None, type='str'),
+ chdir=dict(required=True, default=None, type='str'),
+ ),
+ )
+ args = dict(
+ changed=False,
+ failed=False,
+ target=module.params['target'],
+ params=module.params['params'],
+ extra_args=module.params['extra_args'],
+ chdir=module.params['chdir'],
+ )
+ make_path = module.get_bin_path('make', True)
+
+ # Check if target is up to date
+ args['changed'] = check_changed(make_path, module, args)
+
+ # Check only; don't modify
+ if module.check_mode:
+ module.exit_json(changed=args['changed'])
+
+ # Target is already up to date
+ if not args['changed']:
+ module.exit_json(**args)
+
+ run_make(make_path, module, args)
+ module.exit_json(**args)
+
+from ansible.module_utils.basic import *
+
+if __name__ == '__main__':
+ main()
+
diff --git a/ansible/library/my_os_networks_facts.py b/ansible/library/my_os_networks_facts.py
new file mode 100644
index 000000000..1b6ad80f9
--- /dev/null
+++ b/ansible/library/my_os_networks_facts.py
@@ -0,0 +1,144 @@
+#!/usr/bin/python
+
+# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+---
+module: my_os_network_facts
+short_description: Retrieve facts about one or more OpenStack networks.
+version_added: "2.0"
+author: "Davide Agnello (@dagnello)"
+description:
+ - Retrieve facts about one or more networks from OpenStack.
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+ network:
+ description:
+ - Name or ID of the Network
+ required: false
+ filters:
+ description:
+ - A dictionary of meta data to use for further filtering. Elements of
+ this dictionary may be additional dictionaries.
+ required: false
+extends_documentation_fragment: openstack
+'''
+
+EXAMPLES = '''
+# Gather facts about previously created networks
+- my_os_network_facts:
+ auth:
+ auth_url: https://your_api_url.com:9000/v2.0
+ username: user
+ password: password
+ project_name: someproject
+- debug: var=openstack_networks
+
+# Gather facts about a previously created network by name
+- my_os_network_facts:
+ auth:
+ auth_url: https://your_api_url.com:9000/v2.0
+ username: user
+ password: password
+ project_name: someproject
+ name: network1
+- debug: var=openstack_networks
+
+# Gather facts about a previously created network with filter (note: name and
+ filters parameters are Not mutually exclusive)
+- my_os_network_facts:
+ auth:
+ auth_url: https://your_api_url.com:9000/v2.0
+ username: user
+ password: password
+ project_name: someproject
+ filters:
+ tenant_id: 55e2ce24b2a245b09f181bf025724cbe
+ subnets:
+ - 057d4bdf-6d4d-4728-bb0f-5ac45a6f7400
+ - 443d4dc0-91d4-4998-b21c-357d10433483
+- debug: var=openstack_networks
+'''
+
+RETURN = '''
+openstack_networks:
+ description: has all the openstack facts about the networks
+ returned: always, but can be null
+ type: complex
+ contains:
+ id:
+ description: Unique UUID.
+ returned: success
+ type: string
+ name:
+ description: Name given to the network.
+ returned: success
+ type: string
+ status:
+ description: Network status.
+ returned: success
+ type: string
+ subnets:
+ description: Subnet(s) included in this network.
+ returned: success
+ type: list of strings
+ tenant_id:
+ description: Tenant id associated with this network.
+ returned: success
+ type: string
+ shared:
+ description: Network shared flag.
+ returned: success
+ type: boolean
+'''
+
+def main():
+
+ argument_spec = openstack_full_argument_spec(
+ network={'required': False, 'default': None},
+ filters={'required': False, 'default': None}
+ )
+ module_kwargs = openstack_module_kwargs()
+ module = AnsibleModule(argument_spec)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+ network = module.params.pop('network')
+ filters = module.params.pop('filters')
+
+ try:
+ cloud = shade.openstack_cloud(**module.params)
+ networks = cloud.search_networks(network, filters)
+ module.exit_json(changed=False, ansible_facts={
+ 'openstack_networks': networks})
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+# this is magic, see lib/ansible/module_common.py
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/my_os_router_facts.py b/ansible/library/my_os_router_facts.py
new file mode 100644
index 000000000..ce8d2af25
--- /dev/null
+++ b/ansible/library/my_os_router_facts.py
@@ -0,0 +1,113 @@
+#!/usr/bin/python
+
+# Copyright (c) 2016 IBM
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+module: my_os_router_facts
+short_description: Retrieve facts about routers within OpenStack.
+version_added: "2.1"
+author: "Originally: David Shrewsbury (@Shrews); modified"
+description:
+ - Retrieve facts about routers from OpenStack.
+notes:
+ - Facts are placed in the C(openstack_routers) variable.
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+ port:
+ description:
+ - Unique name or ID of a port.
+ required: false
+ default: null
+ filters:
+ description:
+ - A dictionary of meta data to use for further filtering. Elements
+ of this dictionary will be matched against the returned port
+ dictionaries. Matching is currently limited to strings within
+ the port dictionary, or strings within nested dictionaries.
+ required: false
+ default: null
+extends_documentation_fragment: openstack
+'''
+
+EXAMPLES = '''
+# Gather facts about all routers
+- my_os_router_facts:
+ cloud: mycloud
+
+# Gather facts about a single port
+- my_os_router_facts:
+ cloud: mycloud
+ port: 6140317d-e676-31e1-8a4a-b1913814a471
+
+# Gather facts about all routers that have device_id set to a specific value
+# and with a status of ACTIVE.
+- my_os_router_facts:
+ cloud: mycloud
+ router:
+ description:
+ - Name or ID of the router
+ required: false
+ filters:
+ device_id: 1038a010-3a37-4a9d-82ea-652f1da36597
+ status: ACTIVE
+'''
+
+RETURN = '''
+openstack_routers:
+ description: List of port dictionaries. A subset of the dictionary keys
+ listed below may be returned, depending on your cloud provider.
+ returned: always, but can be null
+ type: complex
+ contains:
+'''
+
+
+def main():
+ argument_spec = openstack_full_argument_spec(
+ router={'required': False, 'default': None},
+ filters={'required': False, 'type': 'dict', 'default': None},
+ )
+ module_kwargs = openstack_module_kwargs()
+ module = AnsibleModule(argument_spec, **module_kwargs)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+ name = module.params.pop('name')
+ filters = module.params.pop('filters')
+
+ try:
+ cloud = shade.openstack_cloud(**module.params)
+ routers = cloud.search_routers(name, filters)
+ module.exit_json(changed=False, ansible_facts=dict(
+ openstack_routers=routers))
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/os_images_facts.py b/ansible/library/os_images_facts.py
new file mode 100644
index 000000000..736403893
--- /dev/null
+++ b/ansible/library/os_images_facts.py
@@ -0,0 +1,166 @@
+#!/usr/bin/python
+
+# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+module: os_images_facts
+short_description: Retrieve facts about an image within OpenStack.
+version_added: "2.0"
+author: "Originally: Davide Agnello (@dagnello); modified"
+description:
+ - Retrieve facts about a image image from OpenStack.
+notes:
+ - Facts are placed in the C(openstack) variable.
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+ image:
+ description:
+ - Name or ID of the image
+ required: false
+ filters:
+ description:
+ - A dictionary of meta data to use for further filtering. Elements of
+ this dictionary may be additional dictionaries.
+ required: false
+extends_documentation_fragment: openstack
+'''
+
+EXAMPLES = '''
+# Gather facts about a previously created image named image1
+- os_images_facts:
+ auth:
+ auth_url: https://your_api_url.com:9000/v2.0
+ username: user
+ password: password
+ project_name: someproject
+ image: image1
+- debug: var=openstack
+'''
+
+RETURN = '''
+openstack_image:
+ description: has all the openstack facts about the image
+ returned: always, but can be null
+ type: complex
+ contains:
+ id:
+ description: Unique UUID.
+ returned: success
+ type: string
+ name:
+ description: Name given to the image.
+ returned: success
+ type: string
+ status:
+ description: Image status.
+ returned: success
+ type: string
+ created_at:
+ description: Image created at timestamp.
+ returned: success
+ type: string
+ deleted:
+ description: Image deleted flag.
+ returned: success
+ type: boolean
+ container_format:
+ description: Container format of the image.
+ returned: success
+ type: string
+ min_ram:
+ description: Min amount of RAM required for this image.
+ returned: success
+ type: int
+ disk_format:
+ description: Disk format of the image.
+ returned: success
+ type: string
+ updated_at:
+ description: Image updated at timestamp.
+ returned: success
+ type: string
+ properties:
+ description: Additional properties associated with the image.
+ returned: success
+ type: dict
+ min_disk:
+ description: Min amount of disk space required for this image.
+ returned: success
+ type: int
+ protected:
+ description: Image protected flag.
+ returned: success
+ type: boolean
+ checksum:
+ description: Checksum for the image.
+ returned: success
+ type: string
+ owner:
+ description: Owner for the image.
+ returned: success
+ type: string
+ is_public:
+ description: Is public flag of the image.
+ returned: success
+ type: boolean
+ deleted_at:
+ description: Image deleted at timestamp.
+ returned: success
+ type: string
+ size:
+ description: Size of the image.
+ returned: success
+ type: int
+'''
+
+
+def main():
+
+ argument_spec = openstack_full_argument_spec(
+ image={'required': False, 'default': None},
+ filters={'required': False, 'default': None},
+ )
+ module_kwargs = openstack_module_kwargs()
+ module = AnsibleModule(argument_spec, **module_kwargs)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+ image = module.params.pop('image')
+ filters = module.params.pop('filters')
+
+ try:
+ cloud = shade.openstack_cloud(**module.params)
+ images = cloud.search_images(image, filters)
+ module.exit_json(changed=False, ansible_facts={
+ 'openstack_images': images})
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+# this is magic, see lib/ansible/module_common.py
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/os_router_facts.py b/ansible/library/os_router_facts.py
new file mode 100644
index 000000000..b14a362ef
--- /dev/null
+++ b/ansible/library/os_router_facts.py
@@ -0,0 +1,113 @@
+#!/usr/bin/python
+
+# Copyright (c) 2016 IBM
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+module: os_router_facts
+short_description: Retrieve facts about routers within OpenStack.
+version_added: "2.1"
+author: "Originally: David Shrewsbury (@Shrews); modified"
+description:
+ - Retrieve facts about routers from OpenStack.
+notes:
+ - Facts are placed in the C(openstack_routers) variable.
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+ port:
+ description:
+ - Unique name or ID of a port.
+ required: false
+ default: null
+ filters:
+ description:
+ - A dictionary of meta data to use for further filtering. Elements
+ of this dictionary will be matched against the returned port
+ dictionaries. Matching is currently limited to strings within
+ the port dictionary, or strings within nested dictionaries.
+ required: false
+ default: null
+extends_documentation_fragment: openstack
+'''
+
+EXAMPLES = '''
+# Gather facts about all routers
+- os_router_facts:
+ cloud: mycloud
+
+# Gather facts about a single port
+- os_router_facts:
+ cloud: mycloud
+ port: 6140317d-e676-31e1-8a4a-b1913814a471
+
+# Gather facts about all routers that have device_id set to a specific value
+# and with a status of ACTIVE.
+- os_router_facts:
+ cloud: mycloud
+ router:
+ description:
+ - Name or ID of the router
+ required: false
+ filters:
+ device_id: 1038a010-3a37-4a9d-82ea-652f1da36597
+ status: ACTIVE
+'''
+
+RETURN = '''
+openstack_routers:
+ description: List of port dictionaries. A subset of the dictionary keys
+ listed below may be returned, depending on your cloud provider.
+ returned: always, but can be null
+ type: complex
+ contains:
+'''
+
+
+def main():
+ argument_spec = openstack_full_argument_spec(
+ router={'required': False, 'default': None},
+ filters={'required': False, 'type': 'dict', 'default': None},
+ )
+ module_kwargs = openstack_module_kwargs()
+ module = AnsibleModule(argument_spec, **module_kwargs)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+ router = module.params.pop('router')
+ filters = module.params.pop('filters')
+
+ try:
+ cloud = shade.openstack_cloud(**module.params)
+ routers = cloud.search_routers(router, filters)
+ module.exit_json(changed=False, ansible_facts=dict(
+ openstack_routers=routers))
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/os_stack_facts.py b/ansible/library/os_stack_facts.py
new file mode 100644
index 000000000..c67947686
--- /dev/null
+++ b/ansible/library/os_stack_facts.py
@@ -0,0 +1,83 @@
+#!/usr/bin/python
+
+# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+module: os_stack_facts
+short_description: Retrieve facts about an stack within OpenStack.
+version_added: "2.0"
+author: "Originally: Davide Agnello (@dagnello); modified"
+description:
+ - Retrieve facts about a stack from OpenStack.
+notes:
+ - Facts are placed in the C(openstack) variable.
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+extends_documentation_fragment: openstack
+'''
+
+EXAMPLES = '''
+# Gather facts about a previously created stack named stack1
+- os_stack_facts:
+ auth:
+ auth_url: https://your_api_url.com:9000/v2.0
+ username: user
+ password: password
+ project_name: someproject
+- debug: var=openstack_stacks
+'''
+
+RETURN = '''
+openstack_stack:
+ description: has all the openstack facts about the stack
+ returned: always, but can be null
+ type: complex
+'''
+
+
+def main():
+
+ argument_spec = openstack_full_argument_spec(
+ )
+ module_kwargs = openstack_module_kwargs()
+ module = AnsibleModule(argument_spec, **module_kwargs)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+
+ try:
+ cloud = shade.openstack_cloud(**module.params)
+ stacks = cloud.list_stacks()
+ module.exit_json(changed=False, ansible_facts={
+ 'openstack_stacks': stacks})
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+# this is magic, see lib/ansible/module_common.py
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/parse_shell_file.py b/ansible/library/parse_shell_file.py
new file mode 100644
index 000000000..d238d108f
--- /dev/null
+++ b/ansible/library/parse_shell_file.py
@@ -0,0 +1,49 @@
+#!/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.
+
+DOCUMENTATION = '''
+---
+module: write_string
+short_description: write a string to a file
+description:
+ - write a string to a file without using temp files
+options:
+ path: path to write to
+ val: string to write
+ mode: python file mode (w, wb, a, ab)
+'''
+
+
+def main():
+ module = AnsibleModule(
+ argument_spec={
+ 'path': {'required': True, 'type': 'path', 'aliases': ['dest']},
+ 'fact_name': {'required': True},
+ }
+ )
+ params = module.params
+ path = params['path']
+ fact_name = params['fact_name']
+ with open(path) as file_object:
+ script = file_object.read()
+ variables = dict(l.split('=') for l in shlex.split(script) if '=' in l)
+ module.exit_json(changed=True, ansible_facts={fact_name: variables})
+
+
+# <<INCLUDE_ANSIBLE_MODULE_COMMON>>
+from ansible.module_utils.basic import * # noqa
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/parted.py b/ansible/library/parted.py
new file mode 100755
index 000000000..af9c80f7e
--- /dev/null
+++ b/ansible/library/parted.py
@@ -0,0 +1,705 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# (c) 2016, Fabrizio Colonna <colofabrix@tin.it>
+#
+# This file is part of Ansible
+#
+# Ansible is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Ansible is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+
+ANSIBLE_METADATA = {'metadata_version': '1.0',
+ 'status': ['preview'],
+ 'supported_by': 'curated'}
+
+
+DOCUMENTATION = '''
+---
+author:
+ - "Fabrizio Colonna (@ColOfAbRiX)"
+module: parted
+short_description: Configure block device partitions
+version_added: "2.3"
+description:
+ - This module allows configuring block device partition using the C(parted)
+ command line tool. For a full description of the fields and the options
+ check the GNU parted manual.
+notes:
+ - When fetching information about a new disk and when the version of parted
+ installed on the system is before version 3.1, the module queries the kernel
+ through C(/sys/) to obtain disk information. In this case the units CHS and
+ CYL are not supported.
+requirements:
+ - This module requires parted version 1.8.3 and above.
+ - If the version of parted is below 3.1, it requires a Linux version running
+ the sysfs file system C(/sys/).
+options:
+ device:
+ description: The block device (disk) where to operate.
+ required: True
+ align:
+ description: Set alignment for newly created partitions.
+ choices: ['none', 'cylinder', 'minimal', 'optimal']
+ default: optimal
+ number:
+ description:
+ - The number of the partition to work with or the number of the partition
+ that will be created. Required when performing any action on the disk,
+ except fetching information.
+ unit:
+ description:
+ - Selects the current default unit that Parted will use to display
+ locations and capacities on the disk and to interpret those given by the
+ user if they are not suffixed by an unit. When fetching information about
+ a disk, it is always recommended to specify a unit.
+ choices: [
+ 's', 'B', 'KB', 'KiB', 'MB', 'MiB', 'GB', 'GiB', 'TB', 'TiB', '%', 'cyl',
+ 'chs', 'compact'
+ ]
+ default: KiB
+ label:
+ description: Creates a new disk label.
+ choices: [
+ 'aix', 'amiga', 'bsd', 'dvh', 'gpt', 'loop', 'mac', 'msdos', 'pc98',
+ 'sun', ''
+ ]
+ default: msdos
+ part_type:
+ description:
+ - Is one of 'primary', 'extended' or 'logical' and may be specified only
+ with 'msdos' or 'dvh' partition tables. A name must be specified for a
+ 'gpt' partition table. Neither part-type nor name may be used with a
+ 'sun' partition table.
+ choices: ['primary', 'extended', 'logical']
+ part_start:
+ description:
+ - Where the partition will start as offset from the beginning of the disk,
+ that is, the "distance" from the start of the disk. The distance can be
+ specified with all the units supported by parted (except compat) and
+ it is case sensitive. E.g. C(10GiB), C(15%).
+ default: 0%
+ part_end :
+ description:
+ - Where the partition will end as offset from the beginning of the disk,
+ that is, the "distance" from the start of the disk. The distance can be
+ specified with all the units supported by parted (except compat) and
+ it is case sensitive. E.g. C(10GiB), C(15%).
+ default: 100%
+ name:
+ description:
+ - Sets the name for the partition number (GPT, Mac, MIPS and PC98 only).
+ flags:
+ description: A list of the flags that has to be set on the partition.
+ state:
+ description:
+ - If to create or delete a partition. If set to C(info) the module will
+ only return the device information.
+ choices: ['present', 'absent', 'info']
+ default: info
+'''
+
+RETURN = '''
+partition_info:
+ description: Current partition information
+ returned: success
+ type: dict
+ contains:
+ device:
+ description: Generic device information.
+ type: dict
+ partitions:
+ description: List of device partitions.
+ type: list
+ sample: >
+ {
+ "disk": {
+ "dev": "/dev/sdb",
+ "logical_block": 512,
+ "model": "VMware Virtual disk",
+ "physical_block": 512,
+ "size": 5.0,
+ "table": "msdos",
+ "unit": "gib"
+ },
+ "partitions": [{
+ "begin": 0.0,
+ "end": 1.0,
+ "flags": ["boot", "lvm"],
+ "fstype": null,
+ "num": 1,
+ "size": 1.0
+ }, {
+ "begin": 1.0,
+ "end": 5.0,
+ "flags": [],
+ "fstype": null,
+ "num": 2,
+ "size": 4.0
+ }]
+ }
+'''
+
+EXAMPLES = """
+# Create a new primary partition
+- parted:
+ device: /dev/sdb
+ number: 1
+ state: present
+
+# Remove partition number 1
+- parted:
+ device: /dev/sdb
+ number: 1
+ state: absent
+
+# Create a new primary partition with a size of 1GiB
+- parted:
+ device: /dev/sdb
+ number: 1
+ state: present
+ part_end: 1gib
+
+# Create a new primary partition for LVM
+- parted:
+ device: /dev/sdb
+ number: 2
+ flags: [ lvm ]
+ state: present
+ part_start: 1gib
+
+# Read device information (always use unit when probing)
+- parted: device=/dev/sdb unit=MiB
+ register: sdb_info
+
+# Remove all partitions from disk
+- parted:
+ device: /dev/sdb
+ number: "{{ item.num }}"
+ state: absent
+ with_items:
+ - "{{ sdb_info.partitions }}"
+"""
+
+
+from ansible.module_utils.basic import AnsibleModule
+import locale
+import math
+import re
+import os
+
+
+# Reference prefixes (International System of Units and IEC)
+units_si = ['B', 'KB', 'MB', 'GB', 'TB']
+units_iec = ['B', 'KiB', 'MiB', 'GiB', 'TiB']
+parted_units = units_si + units_iec + ['s', '%', 'cyl', 'chs', 'compact']
+
+
+def parse_unit(size_str, unit=''):
+ """
+ Parses a string containing a size of information
+ """
+ matches = re.search(r'^([\d.]+)([\w%]+)?$', size_str)
+ if matches is None:
+ # "<cylinder>,<head>,<sector>" format
+ matches = re.search(r'^(\d+),(\d+),(\d+)$', size_str)
+ if matches is None:
+ module.fail_json(
+ msg="Error interpreting parted size output: '%s'" % size_str
+ )
+
+ size = {
+ 'cylinder': int(matches.group(1)),
+ 'head': int(matches.group(2)),
+ 'sector': int(matches.group(3))
+ }
+ unit = 'chs'
+
+ else:
+ # Normal format: "<number>[<unit>]"
+ if matches.group(2) is not None:
+ unit = matches.group(2)
+
+ size = float(matches.group(1))
+
+ return size, unit
+
+
+def parse_partition_info(parted_output, unit):
+ """
+ Parses the output of parted and transforms the data into
+ a dictionary.
+
+ Parted Machine Parseable Output:
+ See: https://lists.alioth.debian.org/pipermail/parted-devel/2006-December/00
+ 0573.html
+ - All lines end with a semicolon (;)
+ - The first line indicates the units in which the output is expressed.
+ CHS, CYL and BYT stands for CHS, Cylinder and Bytes respectively.
+ - The second line is made of disk information in the following format:
+ "path":"size":"transport-type":"logical-sector-size":"physical-sector-siz
+ e":"partition-table-type":"model-name";
+ - If the first line was either CYL or CHS, the next line will contain
+ information on no. of cylinders, heads, sectors and cylinder size.
+ - Partition information begins from the next line. This is of the format:
+ (for BYT)
+ "number":"begin":"end":"size":"filesystem-type":"partition-name":"flags-s
+ et";
+ (for CHS/CYL)
+ "number":"begin":"end":"filesystem-type":"partition-name":"flags-set";
+ """
+ lines = [x for x in parted_output.split('\n') if x.strip() != '']
+
+ # Generic device info
+ generic_params = lines[1].rstrip(';').split(':')
+
+ # The unit is read once, because parted always returns the same unit
+ size, unit = parse_unit(generic_params[1], unit)
+
+ generic = {
+ 'dev': generic_params[0],
+ 'size': size,
+ 'unit': unit.lower(),
+ 'table': generic_params[5],
+ 'model': generic_params[6],
+ 'logical_block': int(generic_params[3]),
+ 'physical_block': int(generic_params[4])
+ }
+
+ # CYL and CHS have an additional line in the output
+ if unit in ['cyl', 'chs']:
+ chs_info = lines[2].rstrip(';').split(':')
+ cyl_size, cyl_unit = parse_unit(chs_info[3])
+ generic['chs_info'] = {
+ 'cylinders': int(chs_info[0]),
+ 'heads': int(chs_info[1]),
+ 'sectors': int(chs_info[2]),
+ 'cyl_size': cyl_size,
+ 'cyl_size_unit': cyl_unit.lower()
+ }
+ lines = lines[1:]
+
+ parts = []
+ for line in lines[2:]:
+ part_params = line.rstrip(';').split(':')
+
+ # CHS use a different format than BYT, but contrary to what stated by
+ # the author, CYL is the same as BYT. I've tested this undocumented
+ # behaviour down to parted version 1.8.3, which is the first version
+ # that supports the machine parseable output.
+ if unit != 'chs':
+ size = parse_unit(part_params[3])[0]
+ fstype = part_params[4]
+ flags = part_params[5]
+ else:
+ size = ""
+ fstype = part_params[3]
+ flags = part_params[4]
+
+ parts.append({
+ 'num': int(part_params[0]),
+ 'begin': parse_unit(part_params[1])[0],
+ 'end': parse_unit(part_params[2])[0],
+ 'size': size,
+ 'fstype': fstype,
+ 'flags': [f.strip() for f in flags.split(', ') if f != ''],
+ 'unit': unit.lower(),
+ })
+
+ return {'generic': generic, 'partitions': parts}
+
+
+def format_disk_size(size_bytes, unit):
+ """
+ Formats a size in bytes into a different unit, like parted does. It doesn't
+ manage CYL and CHS formats, though.
+ This function has been adapted from https://github.com/Distrotech/parted/blo
+ b/279d9d869ff472c52b9ec2e180d568f0c99e30b0/libparted/unit.c
+ """
+ global units_si, units_iec
+
+ unit = unit.lower()
+
+ # Shortcut
+ if size_bytes == 0:
+ return 0.0
+
+ # Cases where we default to 'compact'
+ if unit in ['', 'compact', 'cyl', 'chs']:
+ index = max(0, int(
+ (math.log10(size_bytes) - 1.0) / 3.0
+ ))
+ unit = 'b'
+ if index < len(units_si):
+ unit = units_si[index]
+
+ # Find the appropriate multiplier
+ multiplier = 1.0
+ if unit in units_si:
+ multiplier = 1000.0 ** units_si.index(unit)
+ elif unit in units_iec:
+ multiplier = 1024.0 ** units_iec.index(unit)
+
+ output = size_bytes / multiplier * (1 + 1E-16)
+
+ # Corrections to round up as per IEEE754 standard
+ if output < 10:
+ w = output + 0.005
+ elif output < 100:
+ w = output + 0.05
+ else:
+ w = output + 0.5
+
+ if w < 10:
+ precision = 2
+ elif w < 100:
+ precision = 1
+ else:
+ precision = 0
+
+ # Round and return
+ return round(output, precision), unit
+
+
+def get_unlabeled_device_info(device, unit):
+ """
+ Fetches device information directly from the kernel and it is used when
+ parted cannot work because of a missing label. It always returns a 'unknown'
+ label.
+ """
+ device_name = os.path.basename(device)
+ base = "/sys/block/%s" % device_name
+
+ vendor = read_record(base + "/device/vendor", "Unknown")
+ model = read_record(base + "/device/model", "model")
+ logic_block = int(read_record(base + "/queue/logical_block_size", 0))
+ phys_block = int(read_record(base + "/queue/physical_block_size", 0))
+ size_bytes = int(read_record(base + "/size", 0)) * logic_block
+
+ size, unit = format_disk_size(size_bytes, unit)
+
+ return {
+ 'generic': {
+ 'dev': device,
+ 'table': "unknown",
+ 'size': size,
+ 'unit': unit,
+ 'logical_block': logic_block,
+ 'physical_block': phys_block,
+ 'model': "%s %s" % (vendor, model),
+ },
+ 'partitions': []
+ }
+
+
+def get_device_info(device, unit):
+ """
+ Fetches information about a disk and its partitions and it returns a
+ dictionary.
+ """
+ global module
+
+ # If parted complains about missing labels, it means there are no partitions.
+ # In this case only, use a custom function to fetch information and emulate
+ # parted formats for the unit.
+ label_needed = check_parted_label(device)
+ if label_needed:
+ return get_unlabeled_device_info(device, unit)
+
+ command = "parted -s -m %s -- unit '%s' print" % (device, unit)
+ rc, out, err = module.run_command(command)
+ if rc != 0 and 'unrecognised disk label' not in err:
+ module.fail_json(msg=(
+ "Error while getting device information with parted "
+ "script: '%s'" % command),
+ rc=rc, out=out, err=err
+ )
+
+ return parse_partition_info(out, unit)
+
+
+def check_parted_label(device):
+ """
+ Determines if parted needs a label to complete its duties. Versions prior
+ to 3.1 don't return data when there is no label. For more information see:
+ http://upstream.rosalinux.ru/changelogs/libparted/3.1/changelog.html
+ """
+ # Check the version
+ parted_major, parted_minor, _ = parted_version()
+ if (parted_major == 3 and parted_minor >= 1) or parted_major > 3:
+ return False
+
+ # Older parted versions return a message in the stdout and RC > 0.
+ rc, out, err = module.run_command("parted -s -m %s print" % device)
+ if rc != 0 and 'unrecognised disk label' in out.lower():
+ return True
+
+ return False
+
+
+def parted_version():
+ """
+ Returns the major and minor version of parted installed on the system.
+ """
+ global module
+
+ rc, out, err = module.run_command("parted --version")
+ if rc != 0:
+ module.fail_json(
+ msg="Failed to get parted version.", rc=rc, out=out, err=err
+ )
+
+ lines = [x for x in out.split('\n') if x.strip() != '']
+ if len(lines) == 0:
+ module.fail_json(msg="Failed to get parted version.", rc=0, out=out)
+
+ matches = re.search(r'^parted.+(\d+)\.(\d+)(?:\.(\d+))?$', lines[0])
+ if matches is None:
+ module.fail_json(msg="Failed to get parted version.", rc=0, out=out)
+
+ # Convert version to numbers
+ major = int(matches.group(1))
+ minor = int(matches.group(2))
+ rev = 0
+ if matches.group(3) is not None:
+ rev = int(matches.group(3))
+
+ return major, minor, rev
+
+
+def parted(script, device, align):
+ """
+ Runs a parted script.
+ """
+ global module
+
+ if script and not module.check_mode:
+ command = "parted -s -m -a %s %s -- %s" % (align, device, script)
+ rc, out, err = module.run_command(command)
+
+ if rc != 0:
+ module.fail_json(
+ msg="Error while running parted script: %s" % command.strip(),
+ rc=rc, out=out, err=err
+ )
+
+
+def read_record(file_path, default=None):
+ """
+ Reads the first line of a file and returns it.
+ """
+ try:
+ f = open(file_path, 'r')
+ try:
+ return f.readline().strip()
+ finally:
+ f.close()
+ except IOError:
+ return default
+
+
+def part_exists(partitions, attribute, number):
+ """
+ Looks if a partition that has a specific value for a specific attribute
+ actually exists.
+ """
+ return any(
+ part[attribute] and
+ part[attribute] == number for part in partitions
+ )
+
+
+def check_size_format(size_str):
+ """
+ Checks if the input string is an allowed size
+ """
+ size, unit = parse_unit(size_str)
+ return unit in parted_units
+
+
+def main():
+ global module, units_si, units_iec
+
+ changed = False
+ output_script = ""
+ script = ""
+ module = AnsibleModule(
+ argument_spec={
+ 'device': {'required': True, 'type': 'str'},
+ 'align': {
+ 'default': 'optimal',
+ 'choices': ['none', 'cylinder', 'minimal', 'optimal'],
+ 'type': 'str'
+ },
+ 'number': {'default': None, 'type': 'int'},
+
+ # unit <unit> command
+ 'unit': {
+ 'default': 'KiB',
+ 'choices': parted_units,
+ 'type': 'str'
+ },
+
+ # mklabel <label-type> command
+ 'label': {
+ 'choices': [
+ 'aix', 'amiga', 'bsd', 'dvh', 'gpt', 'loop', 'mac', 'msdos',
+ 'pc98', 'sun', ''
+ ],
+ 'type': 'str'
+ },
+
+ # mkpart <part-type> [<fs-type>] <start> <end> command
+ 'part_type': {
+ 'default': 'primary',
+ 'choices': ['primary', 'extended', 'logical'],
+ 'type': 'str'
+ },
+ 'part_start': {'default': '0%', 'type': 'str'},
+ 'part_end': {'default': '100%', 'type': 'str'},
+
+ # name <partition> <name> command
+ 'name': {'type': 'str'},
+
+ # set <partition> <flag> <state> command
+ 'flags': {'type': 'list'},
+
+ # rm/mkpart command
+ 'state': {
+ 'choices': ['present', 'absent', 'info'],
+ 'default': 'info',
+ 'type': 'str'
+ }
+ },
+ supports_check_mode=True,
+ )
+
+ # Data extraction
+ device = module.params['device']
+ align = module.params['align']
+ number = module.params['number']
+ unit = module.params['unit']
+ label = module.params['label']
+ part_type = module.params['part_type']
+ part_start = module.params['part_start']
+ part_end = module.params['part_end']
+ name = module.params['name']
+ state = module.params['state']
+ flags = module.params['flags']
+
+ # Conditioning
+ if number and number < 0:
+ module.fail_json(msg="The partition number must be non negative.")
+ if not check_size_format(part_start):
+ module.fail_json(
+ msg="The argument 'part_start' doesn't respect required format."
+ "The size unit is case sensitive.",
+ err=parse_unit(part_start)
+ )
+ if not check_size_format(part_end):
+ module.fail_json(
+ msg="The argument 'part_end' doesn't respect required format."
+ "The size unit is case sensitive.",
+ err=parse_unit(part_end)
+ )
+
+ # Read the current disk information
+ current_device = get_device_info(device, unit)
+ current_parts = current_device['partitions']
+
+ if state == 'present':
+ # Default value for the label
+ if not current_device['generic']['table'] or \
+ current_device['generic']['table'] == 'unknown' and \
+ not label:
+ label = 'msdos'
+
+ # Assign label if required
+ if label:
+ script += "mklabel %s " % label
+
+ # Create partition if required
+ if part_type and not part_exists(current_parts, 'num', number):
+ script += "mkpart %s %s %s " % (
+ part_type,
+ part_start,
+ part_end
+ )
+
+ # Set the unit of the run
+ if unit and script:
+ script = "unit %s %s" % (unit, script)
+
+ # Execute the script and update the data structure.
+ # This will create the partition for the next steps
+ if script:
+ output_script += script
+ parted(script, device, align)
+ changed = True
+ script = ""
+
+ current_parts = get_device_info(device, unit)['partitions']
+
+ if part_exists(current_parts, 'num', number) or module.check_mode:
+ partition = {'flags': []} # Empty structure for the check-mode
+ if not module.check_mode:
+ partition = [p for p in current_parts if p['num'] == number][0]
+
+ # Assign name to the the partition
+ if name:
+ script += "name %s %s " % (number, name)
+
+ # Manage flags
+ if flags:
+ # Compute only the changes in flags status
+ flags_off = list(set(partition['flags']) - set(flags))
+ flags_on = list(set(flags) - set(partition['flags']))
+
+ for f in flags_on:
+ script += "set %s %s on " % (number, f)
+
+ for f in flags_off:
+ script += "set %s %s off " % (number, f)
+
+ # Set the unit of the run
+ if unit and script:
+ script = "unit %s %s" % (unit, script)
+
+ # Execute the script
+ if script:
+ output_script += script
+ changed = True
+ parted(script, device, align)
+
+ elif state == 'absent':
+ # Remove the partition
+ if part_exists(current_parts, 'num', number) or module.check_mode:
+ script = "rm %s " % number
+ output_script += script
+ changed = True
+ parted(script, device, align)
+
+ elif state == 'info':
+ output_script = "unit '%s' print " % unit
+
+ # Final status of the device
+ final_device_status = get_device_info(device, unit)
+ module.exit_json(
+ changed=changed,
+ disk=final_device_status['generic'],
+ partitions=final_device_status['partitions'],
+ script=output_script.strip()
+ )
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/library/write_string.py b/ansible/library/write_string.py
new file mode 100644
index 000000000..9db88fdd0
--- /dev/null
+++ b/ansible/library/write_string.py
@@ -0,0 +1,51 @@
+#!/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.
+
+DOCUMENTATION = '''
+---
+module: write_string
+short_description: write a string to a file
+description:
+ - write a string to a file without using temp files
+options:
+ path: path to write to
+ val: string to write
+ mode: python file mode (w, wb, a, ab)
+'''
+
+
+def main():
+ module = AnsibleModule(
+ argument_spec={
+ 'path': {'required': True, 'type': 'path', 'aliases': ['dest']},
+ 'val': {'required': True, 'type': 'str'},
+ 'mode': {'required': False, 'default': "w", 'type': 'str',
+ 'choices': ['w', 'wb', 'a', 'ab']}}
+ )
+ params = module.params
+ path = params['path']
+ mode = params['mode']
+ val = params['val']
+ with open(path, mode) as file_object:
+ file_object.write(val)
+
+ module.exit_json(changed=True)
+
+
+# <<INCLUDE_ANSIBLE_MODULE_COMMON>>
+from ansible.module_utils.basic import * # noqa
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/list_stacks.yml b/ansible/list_stacks.yml
new file mode 100644
index 000000000..ef1b74389
--- /dev/null
+++ b/ansible/list_stacks.yml
@@ -0,0 +1,21 @@
+# 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: yardstick
+
+ roles:
+ - convert_openrc
+ - delete_heat_stacks
+
+
diff --git a/ansible/load_images.yml b/ansible/load_images.yml
new file mode 100644
index 000000000..7cf34adec
--- /dev/null
+++ b/ansible/load_images.yml
@@ -0,0 +1,70 @@
+# 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: yardstick
+ vars_files:
+ - yardstick_config.yml
+ vars:
+ YARD_IMG_ARCH: amd64
+ HW_FW_TYPE: "{{ HW_FW_TYPES[YARD_IMG_ARCH] }}"
+ HW_FW_TYPES:
+ amd64: ''
+ arm64: 'uefi'
+ DEPLOY_VARS:
+ 'lxd':
+ IMAGE_COMMAND: yardstick-img-lxd-modify
+ IMAGE_OUTPUT: "/tmp/workspace/yardstick/yardstick-image.img"
+ 'default':
+ IMAGE_COMMAND: yardstick-img-modify
+ IMAGE_OUTPUT: "/tmp/workspace/yardstick/yardstick-image.tar.gz"
+
+# QCOW_IMAGE: "/tmp/workspace/yardstick/yardstick-image.img"
+# RAW_IMAGE: "/tmp/workspace/yardstick/yardstick-image.tar.gz"
+# IMAGE_COMMANDS:
+# 'lxd': yardstick-img-lxd-modify
+# 'default': yardstick-img-modify
+
+
+ roles:
+ - role: add_fuel_jumphost
+ when: "INSTALLER_TYPE == 'fuel'"
+ - role: detect_fuel_arch
+ when: "INSTALLER_TYPE == 'fuel'"
+
+# post_tasks:
+#
+# - command: "{{ DEPLOY_VARS[DEPLOY_SCENARIO].IMAGE_COMMAND }}" "{{ IMAGE_MODIFY_SCRIPT }}"
+# become: true
+# register: image_modify_result
+# retries: 2
+# untils: image_modify_result|succeeded
+#
+# - stat: path="{{ DEPLOY_VARS[DEPLOY_SCENARIO].IMAGE_OUTPUT }}"}
+# register: output_stat
+#
+# - fail: msg=""
+# when: not output_stat
+
+
+- include: build_yardstick_image.yml
+
+# TEMP
+#- include: image_uploaders/upload_yardstick_image.yml
+
+# upload cirros
+# upload vanilla ubuntu cloud_image
+
+# - include: create_flavors.yml
+
+
diff --git a/ansible/post_build_yardstick_image.yml b/ansible/post_build_yardstick_image.yml
new file mode 100644
index 000000000..b0c418721
--- /dev/null
+++ b/ansible/post_build_yardstick_image.yml
@@ -0,0 +1,44 @@
+# 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: localhost
+
+ tasks:
+ - group_by:
+ key: image_builder
+
+ - name: remove ubuntu policy-rc.d workaround
+ file:
+ path: "{{ mountdir }}/usr/sbin/policy-rc.d"
+ state: absent
+ when: "target_os == 'Ubuntu'"
+
+ - name: cleanup fake tmp fstab
+ file:
+ path: "{{ fake_fstab }}"
+ state: absent
+
+ - mount:
+ name: "{{ mountdir }}/proc"
+ state: unmounted
+
+ - mount:
+ name: "{{ mountdir }}"
+ state: unmounted
+
+ - 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/prepare_env.yml b/ansible/prepare_env.yml
new file mode 100644
index 000000000..a1299c38e
--- /dev/null
+++ b/ansible/prepare_env.yml
@@ -0,0 +1,69 @@
+# 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: yardstick
+ vars_files:
+ - yardstick_config.yml
+
+ pre_tasks:
+ - name: check for openrc
+ stat: path="{{ OPENRC }}"
+ ignore_errors: yes
+ register: openrc_stat
+
+ - set_fact:
+ openrc_present: "{{ openrc_stat.stat.isreg|default(False) }}"
+
+ - fail: msg="{{ INSTALLER_TYPE }} not in {{ INSTALLERS }}"
+ when: not openrc_present and (INSTALLER_TYPE not in INSTALLERS)
+
+ - name: fetch OS credentials
+ command: "{{ RELENG_REPO_DIR }}/utils/fetch_os_creds.sh {{ '-v' if DEPLOY_TYPE == 'virt' else '' }} -d {{ OPENRC }} -i {{ INSTALLER_TYPE }} -a {{ INSTALLER_IP }}"
+ when: not openrc_present
+
+
+ roles:
+ - role: convert_openrc
+ openrc_file: "{{ OPENRC }}"
+ cloud_yaml_path: "{{ opnfv_root }}/clouds.yaml"
+ - role: create_storperf_admin_rc
+ - role: add_fuel_jumphost
+ when: "INSTALLER_TYPE == 'fuel'"
+
+
+ post_tasks:
+ # if huawei-pod1 then copy storeperf_adminrc to deployment location?
+ - name: add huawei-pod1 so we can copy storeperf_admin-rc to pod
+ add_host:
+ name: huawei-pod1
+ ansible_ssh_host: "192.168.200.1"
+ ansible_ssh_pass: root
+ ansible_ssh_use: root
+ when: "NODE_NAME == 'huawei-pod1'"
+
+
+- hosts: huawei-pod1
+ tasks:
+ - name: copy a admin-rc file for StorPerf integration to the deployment location
+ copy:
+ src: "{{ storperf_rc }}"
+ dest: /root/
+
+
+- hosts: fuel_jumphost
+ roles:
+ - create_fuel_pod_yaml
+
+
+
diff --git a/ansible/roles/add_custom_repos/tasks/main.yml b/ansible/roles/add_custom_repos/tasks/main.yml
new file mode 100644
index 000000000..7341ad07d
--- /dev/null
+++ b/ansible/roles/add_custom_repos/tasks/main.yml
@@ -0,0 +1,16 @@
+# 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: "{{ target_os|lower }}.yml"
+
diff --git a/ansible/roles/add_custom_repos/tasks/ubuntu.yml b/ansible/roles/add_custom_repos/tasks/ubuntu.yml
new file mode 100644
index 000000000..c0ba89c0b
--- /dev/null
+++ b/ansible/roles/add_custom_repos/tasks/ubuntu.yml
@@ -0,0 +1,29 @@
+# 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 custom repos
+ template:
+ src: sources.list.j2
+ dest: /etc/apt/sources.list.d/yardstick.list
+
+#- name: Workaround for building on CentOS (apt-get is not working with http sources)
+# replace:
+# path: /etc/apt/sources.list
+# regex: http
+# replace: ftp
+
+- name: Force apt to use ipv4 due to build problems on LF POD.
+ copy:
+ content: 'Acquire::ForceIPv4 "true";'
+ dest: /etc/apt/apt.conf.d/99force-ipv4 \ 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
new file mode 100644
index 000000000..86be348f6
--- /dev/null
+++ b/ansible/roles/add_custom_repos/templates/sources.list.j2
@@ -0,0 +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
+{% else %}
+deb http://archive.ubuntu.com/ubuntu/ {{ ubuntu_release[target_os_version] }}-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
new file mode 100644
index 000000000..03ed6e446
--- /dev/null
+++ b/ansible/roles/add_custom_repos/vars/main.yml
@@ -0,0 +1,3 @@
+ubuntu_release:
+ "16.04": xenial
+ "14.04": trusty \ No newline at end of file
diff --git a/ansible/roles/add_fuel_jumphost/tasks/main.yml b/ansible/roles/add_fuel_jumphost/tasks/main.yml
new file mode 100644
index 000000000..c6793a260
--- /dev/null
+++ b/ansible/roles/add_fuel_jumphost/tasks/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.
+---
+- name: add host for fuel jumphost
+ add_host:
+ name: fuel_jumphost
+ ansible_host: "{{ lookup('env', 'INSTALLER_IP') }}"
+ ansible_pass: r00tme
+ when: "INSTALLER_TYPE == 'fuel'"
diff --git a/ansible/roles/add_heat_stack_owner_role/tasks/main.yml b/ansible/roles/add_heat_stack_owner_role/tasks/main.yml
new file mode 100644
index 000000000..d751eb032
--- /dev/null
+++ b/ansible/roles/add_heat_stack_owner_role/tasks/main.yml
@@ -0,0 +1,24 @@
+# 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.
+# openstack role assignment list --names
+---
+- os_user_role:
+ state: present
+ user: "{{ openrc.OS_USERNAME }}"
+ role: heat_stack_owner
+ project: "{{ item }}"
+ with_items:
+ - demo
+ - admin
+ environment: "{{ openrc }}"
diff --git a/ansible/roles/check_external_network/tasks/main.yml b/ansible/roles/check_external_network/tasks/main.yml
new file mode 100644
index 000000000..586ad74be
--- /dev/null
+++ b/ansible/roles/check_external_network/tasks/main.yml
@@ -0,0 +1,21 @@
+# 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: Get all networks
+ os_networks_facts:
+ name: "{{ EXTERNAL_NETWORK }}"
+ environment: "{{ openrc }}"
+
+- debug: var=openstack_networks
+
diff --git a/ansible/roles/check_openstack_services/tasks/main.yml b/ansible/roles/check_openstack_services/tasks/main.yml
new file mode 100644
index 000000000..02e730533
--- /dev/null
+++ b/ansible/roles/check_openstack_services/tasks/main.yml
@@ -0,0 +1,25 @@
+# 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: Check images
+ os_images_facts: {}
+ environment: "{{ openrc }}"
+
+- name: Check servers
+ os_server_facts: {}
+ environment: "{{ openrc }}"
+
+- name: Check stacks
+ os_stack_facts: {}
+ environment: "{{ openrc }}"
diff --git a/ansible/roles/clean_flavors/tasks/main.yml b/ansible/roles/clean_flavors/tasks/main.yml
new file mode 100644
index 000000000..a34f7e65f
--- /dev/null
+++ b/ansible/roles/clean_flavors/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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: cleanup yardstick flavor
+ os_nova_flavor:
+ state: absent
+ name: yardstick-flavor
+ environment: "{{ openrc }}"
diff --git a/ansible/roles/clean_images/tasks/main.yml b/ansible/roles/clean_images/tasks/main.yml
new file mode 100644
index 000000000..5cbae06d8
--- /dev/null
+++ b/ansible/roles/clean_images/tasks/main.yml
@@ -0,0 +1,32 @@
+# 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: Get all images
+ os_images_facts: {}
+ environment: "{{ openrc }}"
+
+- debug: var=openstack_images
+
+- set_fact:
+ images_to_clean: "{{ openstack_images|map(attribute='name')|select('search', 'yardstick|cirros|Ubuntu-14\\.04')|list }}"
+
+- debug: var=images_to_clean
+
+- name: Cleanup images
+ os_image:
+ state: absent
+ name: "{{ item }}"
+ with_items: "{{ images_to_clean }}"
+ environment: "{{ openrc }}"
+
diff --git a/ansible/roles/convert_openrc/defaults/main.yml b/ansible/roles/convert_openrc/defaults/main.yml
new file mode 100644
index 000000000..dffca1078
--- /dev/null
+++ b/ansible/roles/convert_openrc/defaults/main.yml
@@ -0,0 +1,17 @@
+# 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.
+---
+openrc_file: "openrc"
+cloud_yaml_path: "{{ playbook_dir }}/clouds.yaml"
+
diff --git a/ansible/roles/convert_openrc/tasks/main.yml b/ansible/roles/convert_openrc/tasks/main.yml
new file mode 100644
index 000000000..1606b0bc5
--- /dev/null
+++ b/ansible/roles/convert_openrc/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.
+---
+- name: parse openrc into openstack auth dict
+ parse_shell_file: path="{{ openrc_file }}" fact_name="openrc"
+
+- debug: var=openrc
+
+- set_fact:
+ yardstick_url_ip: "{{ openrc.OS_AUTH_URL|urlsplit|attr('hostname') }}"
+
+- debug: var=yardstick_url_ip
+
+# This doesn't work, due to OS_IDENTITY_API_VERSION, use environment
+
+- set_fact:
+ os_auth:
+ auth_url: "{{ openrc.OS_AUTH_URL }}"
+ password: "{{ openrc.OS_PASSWORD }}"
+ username: "{{ openrc.OS_USERNAME }}"
+ project_name: "{{ openrc.OS_PROJECT_NAME }}"
+# tenant_name: "{{ openrc.OS_TENANT_NAME }}"
+ project_domain_name: "{{ openrc.OS_PROJECT_DOMAIN_NAME }}"
+# user_domain_name: "{{ openrc.OS_USER_DOMAIN_NAME }}"
+ # BUGS: We need to specify identity_api_version == 3, but we can't do it here
+ # because it is not the write place
+ # we need to set it via OS_IDENTITY_API_VERSION or clouds.yaml
+# identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}"
+
+- debug: var=os_auth
+
+- set_fact:
+ clouds:
+ demo:
+ # must specify API version here
+ identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}"
+ auth: "{{ os_auth }}"
+
+- template:
+ src: clouds.yaml.j2
+ # this is autodetected and used
+ dest: "{{ cloud_yaml_path }}"
+ when: write_cloud_yaml|default(False)
+
diff --git a/ansible/roles/convert_openrc/templates/clouds.yaml.j2 b/ansible/roles/convert_openrc/templates/clouds.yaml.j2
new file mode 100644
index 000000000..b1a76cb76
--- /dev/null
+++ b/ansible/roles/convert_openrc/templates/clouds.yaml.j2
@@ -0,0 +1,9 @@
+clouds:
+ demo:
+ identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}"
+ auth:
+ auth_url: "{{ openrc.OS_AUTH_URL }}"
+ password: "{{ openrc.OS_PASSWORD }}"
+ username: "{{ openrc.OS_USERNAME }}"
+ project_name: "{{ openrc.OS_PROJECT_NAME }}"
+ project_domain_name: "{{ openrc.OS_PROJECT_DOMAIN_NAME }}"
diff --git a/ansible/roles/copy_L4Replay/tasks/main.yml b/ansible/roles/copy_L4Replay/tasks/main.yml
new file mode 100644
index 000000000..2f4887dc1
--- /dev/null
+++ b/ansible/roles/copy_L4Replay/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- file:
+ path: "{{ NSB_INSTALL_DIR }}"
+ state: directory
+
+- get_url:
+ url: "{{ L4REPLAY_DOWNLOAD }}"
+ dest: "{{ NSB_INSTALL_DIR }}"
+ checksum: "sha256:4dd17209715af68a95058648ab9314e2737418c836acc45492e987886f38bbe8"
+
+- unarchive:
+ src: "{{ NSB_INSTALL_DIR }}/{{ L4REPLAY_DOWNLOAD|basename }}"
+ dest: "{{ NSB_INSTALL_DIR }}"
+ copy: no
diff --git a/ansible/roles/create_dockerfile/tasks/main.yml b/ansible/roles/create_dockerfile/tasks/main.yml
new file mode 100644
index 000000000..d48f7be3f
--- /dev/null
+++ b/ansible/roles/create_dockerfile/tasks/main.yml
@@ -0,0 +1,82 @@
+# 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:
+ yardstick_image_name: "yardstick_python{{ python_version }}_{{ target_os }}"
+ tags:
+ - create_template
+
+- debug: var=docker_build_dir
+
+- file: dest="{{ docker_build_dir }}" state=directory
+ tags:
+ - create_template
+
+- template: "src={{ target_os }}/Dockerfile dest={{ docker_build_dir }}/Dockerfile"
+ tags:
+ - create_template
+
+- name: bootstrap repos
+ template: "src=Ubuntu-repos.j2 dest={{ docker_build_dir}}/sources.list"
+ when: use_ext == "intr"
+
+- name: Create apt.conf.d/ proxy config
+ template:
+ src: apt_conf.j2
+ dest: "{{ docker_build_dir }}/20proxy"
+ when: "'http_proxy' in proxy_env"
+
+- name: set pip mirror
+ template: "src=pip.conf.j2 dest={{ docker_build_dir }}/pip.conf"
+ when: pip_mirror_url is defined and pip_mirror_url
+
+- name: easy_utils mirror
+ template: "src=pydistutils.cfg.j2 dest={{ docker_build_dir }}/pydistutils.cfg"
+ when: pip_mirror_url is defined and pip_mirror_url
+
+- set_fact:
+ yardstick_base: "{{ docker_registry ~ '/' if docker_registry|default('') else '' }}{{ yardstick_image_name}}"
+
+
+- set_fact:
+ yardstick_base_tag: "{{ docker_image_tag|default('v1') }}"
+
+- debug: var=yardstick_base
+
+#- command: "docker build {{ docker_build_dir }}"
+#- fail: msg="don't build"
+
+- docker_image:
+ name: "{{ yardstick_base }}"
+ tag: "{{ yardstick_base_tag }}"
+ path: "{{ docker_build_dir }}"
+ state: present
+ force: yes
+ rm: true
+ # push is broken, manually push
+ push: no
+ ignore_errors: yes
+ register: docker_image_results
+ when: not release
+- debug: var=docker_image_results
+
+- name: manual push image
+ command: docker push {{ yardstick_base }}
+ when: not release and docker_image_results|changed
+ register: docker_image_push
+ tags:
+ - push_image
+
+- debug: var=docker_image_push
+
diff --git a/ansible/roles/create_dockerfile/templates/centos/Dockerfile b/ansible/roles/create_dockerfile/templates/centos/Dockerfile
new file mode 100644
index 000000000..ca104c8f8
--- /dev/null
+++ b/ansible/roles/create_dockerfile/templates/centos/Dockerfile
@@ -0,0 +1,69 @@
+##############################################################################
+# Copyright (c) 2017 Intel Corporation
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+FROM centos:7.3.1611
+
+LABEL image=opnfv/yardstick
+
+ARG BRANCH=master
+
+# GIT repo directory
+ENV REPOS_DIR /home/opnfv/repos
+
+# Yardstick repo
+ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick
+ENV RELENG_REPO_DIR ${REPOS_DIR}/releng
+
+RUN yum -y install\
+ deltarpm \
+ wget \
+ expect \
+ curl \
+ git \
+ sshpass \
+ ansible \
+ qemu-kvm \
+ qemu-utils \
+ kpartx \
+ libffi-devel \
+ openssl-devel \
+ zeromq2-devel \
+ python \
+ python-devel \
+ libxml2-devel \
+ libxslt-devel \
+ nginx \
+ uwsgi \
+ uwsgi-plugin-python \
+ supervisor \
+ ansible \
+ python-setuptools && \
+ easy_install -U setuptools==30.0.0 && \
+ yum clean all
+
+RUN mkdir -p ${REPOS_DIR} && \
+ git config --global http.sslVerify false && \
+ git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR} && \
+ git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
+
+# install yardstick + dependencies
+# explicity pin pip version to avoid future issues like the ill-fated pip 8.0.0 release
+RUN easy_install -U "pip==${PIP_VERSION}" && \
+ pip install -r ${YARDSTICK_REPO_DIR}/requirements.txt && \
+ pip install ${YARDSTICK_REPO_DIR}
+
+RUN ${YARDSTICK_REPO_DIR}/api/api-prepare.sh
+
+EXPOSE 5000
+
+ADD http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img /home/opnfv/images/
+ADD http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img /home/opnfv/images/
+
+COPY ./exec_tests.sh /usr/local/bin/
+CMD ["/usr/bin/supervisord"]
diff --git a/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile b/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile
new file mode 100644
index 000000000..7fbc4f01a
--- /dev/null
+++ b/ansible/roles/create_dockerfile/templates/ubuntu/Dockerfile
@@ -0,0 +1,82 @@
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+FROM ubuntu:16.04
+
+LABEL image=opnfv/yardstick
+
+ARG BRANCH=master
+
+# GIT repo directory
+ENV REPOS_DIR /home/opnfv/repos
+
+# Yardstick repo
+ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick
+ENV RELENG_REPO_DIR ${REPOS_DIR}/releng
+RUN sed -i -e 's/^deb /deb [arch=amd64] /g;s/^deb-src /# deb-src /g' /etc/apt/sources.list && \
+ echo "\n\
+deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted \n\
+deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted \n\
+deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-security main universe multiverse restricted \n\
+deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-proposed main universe multiverse restricted" >> /etc/apt/sources.list && \
+ dpkg --add-architecture arm64
+
+# WHY? Is this workaround still needed?
+# https://wiki.debian.org/mmap_min_addr#apps
+# qemu, as shipped in Debian 5.0, requires low virtual memory mmaps. mmap_min_addr must be set to 0 to run qemu as a non-root user. This limitation has been removed upstream, so qemu should work with an increased mmap_min_addr starting with Debian squeeze.
+#RUN echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf
+
+# This will prevent questions from being asked during the install
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y \
+ qemu-user-static \
+ libc6:arm64 \
+ wget \
+ expect \
+ curl \
+ git \
+ sshpass \
+ qemu-utils \
+ kpartx \
+ libffi-dev \
+ libssl-dev \
+ libzmq-dev \
+ python \
+ python-dev \
+ libxml2-dev \
+ libxslt1-dev \
+ nginx \
+ uwsgi \
+ uwsgi-plugin-python \
+ supervisor \
+ python-setuptools && \
+ easy_install -U setuptools==30.0.0 && \
+ apt-get -y autoremove && \
+ apt-get clean
+
+RUN mkdir -p ${REPOS_DIR} && \
+ git config --global http.sslVerify false && \
+ git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR} && \
+ git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
+
+# install yardstick + dependencies
+# explicity pin pip version to avoid future issues like the ill-fated pip 8.0.0 release
+RUN easy_install -U "pip==${PIP_VERSION}" && \
+ pip install -r ${YARDSTICK_REPO_DIR}/requirements.txt && \
+ pip install ${YARDSTICK_REPO_DIR}
+
+RUN ${YARDSTICK_REPO_DIR}/api/api-prepare.sh
+
+EXPOSE 5000
+
+ADD http://download.cirros-cloud.net/0.3.3/cirros-0.3.5-x86_64-disk.img /home/opnfv/images/
+ADD http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img /home/opnfv/images/
+
+COPY ./exec_tests.sh /usr/local/bin/
+CMD ["/usr/bin/supervisord"]
diff --git a/ansible/roles/create_flavors/tasks/main.yml b/ansible/roles/create_flavors/tasks/main.yml
new file mode 100644
index 000000000..b0c120c36
--- /dev/null
+++ b/ansible/roles/create_flavors/tasks/main.yml
@@ -0,0 +1,23 @@
+# 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: create yardstick flavor
+ os_nova_flavor:
+ state: present
+ name: yardstick-flavor
+ flavorid: 100
+ ram: 1024
+ disk: 4
+ vcpus: 2
+ environment: "{{ openrc }}"
diff --git a/ansible/roles/create_fuel_pod_yaml/tasks/main.yml b/ansible/roles/create_fuel_pod_yaml/tasks/main.yml
new file mode 100644
index 000000000..b13bc2f08
--- /dev/null
+++ b/ansible/roles/create_fuel_pod_yaml/tasks/main.yml
@@ -0,0 +1,37 @@
+# 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: fetch fuel master ssh key
+ fetch:
+ src: /root/.ssh/id_rsa
+ dest: /root/.ssh/id_rsa
+
+- name: collect fuel node info
+ command: fuel --json node
+ register: fuel_node_output
+
+- name: import fuel json
+ set_fact:
+ fuel_nodes: "{{ fuel_node_output.stdout|from_json }}"
+
+- name: find compute node
+ set_fact:
+ compute_node: "{{ fuel_nodes|find_fuel_nodes.computes_ips[0] }}"
+
+- name: get remote arch
+ command: ssh "{{ compute_node }}" uname -m
+ register: uname_output
+
+- set_fact:
+ YARD_IMG_ARCH: "{{ 'arm64' if uname_output.stdout.strip() == 'aarch64' else 'amd64' }}"
diff --git a/ansible/roles/create_fuel_pod_yaml/templates/fuel_pod.yaml.j2 b/ansible/roles/create_fuel_pod_yaml/templates/fuel_pod.yaml.j2
new file mode 100644
index 000000000..2a038537b
--- /dev/null
+++ b/ansible/roles/create_fuel_pod_yaml/templates/fuel_pod.yaml.j2
@@ -0,0 +1,33 @@
+##############################################################################
+# Copyright (c) 2017 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# sample config file about the POD information, including the
+# name/IP/user/ssh key of Bare Metal and Controllers/Computes
+#
+# The options of this config file include:
+# name: the name of this node
+# role: node's role, support role: Master/Controller/Comupte/BareMetal
+# ip: the node's IP address
+# user: the username for login
+# key_filename:the path of the private key file for login
+# ipX: the ips of the nodes will be fetched by prepare_env.sh and replaced here
+
+nodes:
+{% for fuel_node in fuel_nodes %}
+-
+ name: {{ fuel_node.name }}
+ {% if "contoller" in fuel_node.roles %}
+ role: Controller
+ {% elif "compute" in fuel_node.roles %}
+ role: Compute
+ {% endif %}
+ ip: {{ fuel_node.ip }}
+ user: root
+ key_filename: /root/.ssh/id_rsa
+{% endfor %}
diff --git a/ansible/roles/create_node_pod_yaml/tasks/main.yml b/ansible/roles/create_node_pod_yaml/tasks/main.yml
new file mode 100644
index 000000000..c398737c9
--- /dev/null
+++ b/ansible/roles/create_node_pod_yaml/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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: create pod yaml
+ template:
+ src: pod.yaml.j2
+ dest: "{{ dest_pod_yaml }}"
+ delegate_to: localhost
diff --git a/ansible/roles/create_node_pod_yaml/templates/pod.yaml.j2 b/ansible/roles/create_node_pod_yaml/templates/pod.yaml.j2
new file mode 100644
index 000000000..e51701830
--- /dev/null
+++ b/ansible/roles/create_node_pod_yaml/templates/pod.yaml.j2
@@ -0,0 +1,22 @@
+---
+nodes:
+{% for node in groups[pod_group] %}
+-
+ name: "{{ node }}"
+{% if "control" in hostvars[node].group_names %}
+ role: Controller
+{% elif "compute" in hostvars[node].group_names %}
+ role: Compute
+{% endif %}
+ ip: "{{ hostvars[node].ansible_host }}"
+ user: "{{ hostvars[node].ansible_user }}"
+{% if hostvars[node].ansible_port is defined %}
+ ssh_port: "{{ hostvars[node].ansible_port }}"
+{% endif %}
+{% if hostvars[node].ansible_ssh_pass is defined %}
+ password: "{{ hostvars[node].ansible_ssh_pass }}"
+{% endif %}
+{% if hostvars[node].ansible_ssh_private_key_file is defined %}
+ key_filename: "{{ hostvars[node].ansible_ssh_private_key_file }}"
+{% endif %}
+{% endfor %}
diff --git a/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py b/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py
new file mode 100644
index 000000000..debb8dd5b
--- /dev/null
+++ b/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py
@@ -0,0 +1,167 @@
+#!/usr/bin/python
+# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
+#
+# This module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+
+try:
+ import shade
+ HAS_SHADE = True
+except ImportError:
+ HAS_SHADE = False
+
+DOCUMENTATION = '''
+---
+module: os_project_facts
+short_description: Retrieve facts about one or more OpenStack projects
+extends_documentation_fragment: openstack
+version_added: "2.1"
+author: "Ricardo Carrillo Cruz (@rcarrillocruz)"
+description:
+ - Retrieve facts about a one or more OpenStack projects
+requirements:
+ - "python >= 2.6"
+ - "shade"
+options:
+ name:
+ description:
+ - Name or ID of the project
+ required: true
+ domain:
+ description:
+ - Name or ID of the domain containing the project if the cloud supports domains
+ required: false
+ default: None
+ filters:
+ description:
+ - A dictionary of meta data to use for further filtering. Elements of
+ this dictionary may be additional dictionaries.
+ required: false
+ default: None
+'''
+
+EXAMPLES = '''
+# Gather facts about previously created projects
+- my_os_project_facts:
+ cloud: awesomecloud
+- debug: var=openstack_projects
+
+# Gather facts about a previously created project by name
+- my_os_project_facts:
+ cloud: awesomecloud
+ name: demoproject
+- debug: var=openstack_projects
+
+# Gather facts about a previously created project in a specific domain
+- my_os_project_facts
+ cloud: awesomecloud
+ name: demoproject
+ domain: admindomain
+- debug: var=openstack_projects
+
+# Gather facts about a previously created project in a specific domain
+ with filter
+- my_os_project_facts
+ cloud: awesomecloud
+ name: demoproject
+ domain: admindomain
+ filters:
+ enabled: False
+- debug: var=openstack_projects
+'''
+
+
+RETURN = '''
+openstack_projects:
+ description: has all the OpenStack facts about projects
+ returned: always, but can be null
+ type: complex
+ contains:
+ id:
+ description: Unique UUID.
+ returned: success
+ type: string
+ name:
+ description: Name given to the project.
+ returned: success
+ type: string
+ description:
+ description: Description of the project
+ returned: success
+ type: string
+ enabled:
+ description: Flag to indicate if the project is enabled
+ returned: success
+ type: bool
+ domain_id:
+ description: Domain ID containing the project (keystone v3 clouds only)
+ returned: success
+ type: bool
+'''
+
+def main():
+
+ argument_spec = openstack_full_argument_spec(
+ name=dict(required=False, default=None),
+ domain=dict(required=False, default=None),
+ filters=dict(required=False, type='dict', default=None),
+ )
+
+ module = AnsibleModule(argument_spec)
+
+ if not HAS_SHADE:
+ module.fail_json(msg='shade is required for this module')
+
+ try:
+ name = module.params['name']
+ domain = module.params['domain']
+ filters = module.params['filters']
+
+ opcloud = shade.operator_cloud(**module.params)
+ # module.exit_json(changed=False, ansible_facts=dict(
+ # openstack_prjects=opcloud.cloud_config.get_auth_args()))
+
+ if domain:
+ try:
+ # We assume admin is passing domain id
+ dom = opcloud.get_domain(domain)['id']
+ domain = dom
+ except:
+ # If we fail, maybe admin is passing a domain name.
+ # Note that domains have unique names, just like id.
+ dom = opcloud.search_domains(filters={'name': domain})
+ if dom:
+ domain = dom[0]['id']
+ else:
+ module.fail_json(msg='Domain name or ID does not exist')
+
+ if not filters:
+ filters = {}
+
+ filters['domain_id'] = domain
+
+ # projects = opcloud.search_projects(name, filters)
+ projects = opcloud.list_projects(name, filters)
+ module.exit_json(changed=False, ansible_facts=dict(
+ openstack_projects=projects))
+
+ except shade.OpenStackCloudException as e:
+ module.fail_json(msg=str(e))
+
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible/roles/create_storperf_admin_rc/tasks/main.yml b/ansible/roles/create_storperf_admin_rc/tasks/main.yml
new file mode 100644
index 000000000..bd1418e89
--- /dev/null
+++ b/ansible/roles/create_storperf_admin_rc/tasks/main.yml
@@ -0,0 +1,27 @@
+# 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: Fetch TENANT_ID
+ os_project_facts:
+ name: admin
+ environment: "{{ openrc }}"
+
+- name: Fetch TENANT_ID
+ set_fact:
+ os_tenant_id: "{{ openstack_projects[0].id }}"
+
+- name: Create storperf_admin-rc
+ template:
+ src: storperf_admin-rc.j2
+ dest: "{{ storperf_rc }}"
diff --git a/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2 b/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2
new file mode 100644
index 000000000..410ab24df
--- /dev/null
+++ b/ansible/roles/create_storperf_admin_rc/templates/storperf_admin-rc.j2
@@ -0,0 +1,7 @@
+OS_AUTH_URL="{{ openrc.OS_AUTH_URL }}"
+OS_USERNAME="{{ openrc.OS_USERNAME|default('admin') }}"
+OS_PASSWORD="{{ openrc.OS_PASSWORD|default('console') }}"
+OS_TENANT_NAME="{{ openrc.OS_TENANT_NAME|default('admin') }}"
+OS_VOLUME_API_VERSION="{{ openrc.OS_VOLUME_API_VERSION|default('2') }}"
+OS_PROJECT_NAME="{{ openrc.OS_PROJECT_NAME|default(openrc.OS_TENANT_NAME) }}"
+OS_TENANT_ID="{{ os_tenant_id }}"
diff --git a/ansible/roles/detect_fuel_arch/tasks/main.yml b/ansible/roles/detect_fuel_arch/tasks/main.yml
new file mode 100644
index 000000000..2a5713106
--- /dev/null
+++ b/ansible/roles/detect_fuel_arch/tasks/main.yml
@@ -0,0 +1,25 @@
+# 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: collect fuel node info
+ command: fuel --json node
+ register: fuel_node_output
+
+- name: import fuel json
+ set_fact:
+ fuel_nodes: "{{ fuel_node_output.stdout|from_json }}"
+
+- name: ssh to fuel and get fuel arch
+ shell:
+
diff --git a/ansible/roles/download_cachestat/defaults/main.yml b/ansible/roles/download_cachestat/defaults/main.yml
new file mode 100644
index 000000000..c88cba879
--- /dev/null
+++ b/ansible/roles/download_cachestat/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+cachestat_repo: "https://github.com/beefyamoeba5/cachestat.git"
+cachestat_version: master
+cachestat_dest: "{{ clone_dest }}/Cachestat"
diff --git a/ansible/roles/download_cachestat/tasks/main.yml b/ansible/roles/download_cachestat/tasks/main.yml
new file mode 100644
index 000000000..12175c8fd
--- /dev/null
+++ b/ansible/roles/download_cachestat/tasks/main.yml
@@ -0,0 +1,21 @@
+# 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.
+---
+- git:
+ repo: "{{ cachestat_repo }}"
+ dest: "{{ cachestat_dest }}"
+ version: "{{ cachestat_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
diff --git a/ansible/roles/download_dpdk/defaults/main.yml b/ansible/roles/download_dpdk/defaults/main.yml
new file mode 100644
index 000000000..fb42ed48a
--- /dev/null
+++ b/ansible/roles/download_dpdk/defaults/main.yml
@@ -0,0 +1,10 @@
+---
+dpdk_version: "17.02"
+dpdk_url: "http://dpdk.org/browse/dpdk/snapshot/dpdk-{{ dpdk_version }}.zip"
+dpdk_file: "{{ dpdk_url|basename }}"
+dpdk_unarchive: "{{ dpdk_file|regex_replace('[.]zip$', '') }}"
+dpdk_dest: "{{ clone_dest }}/"
+dpdk_sha256s:
+ "17.02": "sha256:c675285d5eab8e7e8537a10bdae6f03c603caa80cb4bf5b055ddd482e3b7d67f"
+ "16.04": "sha256:65e587af439b21abf54c644f86ba5ce7ea65657b3272480dcd78b769d2aecac3"
+ "16.07": "sha256:46fee52f9b3ff54df869414c69f122aea8f744de5ed5f8fb275a22cc9cefe094"
diff --git a/ansible/roles/download_dpdk/tasks/main.yml b/ansible/roles/download_dpdk/tasks/main.yml
new file mode 100644
index 000000000..322f3cd0c
--- /dev/null
+++ b/ansible/roles/download_dpdk/tasks/main.yml
@@ -0,0 +1,38 @@
+# 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.
+---
+- debug:
+ var: dpdk_version
+ verbosity: 2
+
+- name: fetch dpdk
+ get_url:
+ url: "{{ dpdk_url }}"
+ dest: "{{ dpdk_dest }}"
+ validate_certs: False
+ checksum: "{{ dpdk_sha256s[dpdk_version] }}"
+
+- unarchive:
+ src: "{{ clone_dest }}/{{ dpdk_file }}"
+ dest: "{{ clone_dest }}/"
+ copy: no
+
+- set_fact:
+ dpdk_path: "{{ clone_dest }}/{{ dpdk_unarchive }}"
+
+- set_fact:
+ RTE_SDK: "{{ dpdk_path }}"
+
+- set_fact:
+ RTE_TARGET: "{{ dpdk_make_arch }}"
diff --git a/ansible/roles/download_prox/defaults/main.yml b/ansible/roles/download_prox/defaults/main.yml
new file mode 100644
index 000000000..797db3125
--- /dev/null
+++ b/ansible/roles/download_prox/defaults/main.yml
@@ -0,0 +1,12 @@
+---
+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_prox/tasks/main.yml b/ansible/roles/download_prox/tasks/main.yml
new file mode 100644
index 000000000..0614c74fa
--- /dev/null
+++ b/ansible/roles/download_prox/tasks/main.yml
@@ -0,0 +1,36 @@
+# 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.
+---
+- 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
diff --git a/ansible/roles/download_ramspeed/defaults/main.yml b/ansible/roles/download_ramspeed/defaults/main.yml
new file mode 100644
index 000000000..140ad1197
--- /dev/null
+++ b/ansible/roles/download_ramspeed/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+ramspeed_repo: "https://github.com/beefyamoeba5/ramspeed.git"
+ramspeed_version: master
+ramspeed_dest: "{{ clone_dest }}/RAMspeed"
+ramspeed_release: ramspeed-2.6.0 \ No newline at end of file
diff --git a/ansible/roles/download_ramspeed/tasks/main.yml b/ansible/roles/download_ramspeed/tasks/main.yml
new file mode 100644
index 000000000..8b974eb63
--- /dev/null
+++ b/ansible/roles/download_ramspeed/tasks/main.yml
@@ -0,0 +1,21 @@
+# 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.
+---
+- git:
+ repo: "{{ ramspeed_repo }}"
+ dest: "{{ ramspeed_dest }}"
+ version: "{{ ramspeed_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
diff --git a/ansible/roles/download_samplevnfs/defaults/main.yml b/ansible/roles/download_samplevnfs/defaults/main.yml
new file mode 100644
index 000000000..44449af6f
--- /dev/null
+++ b/ansible/roles/download_samplevnfs/defaults/main.yml
@@ -0,0 +1,6 @@
+---
+samplevnf_version: ""
+samplevnf_file: "{{ samplevnf_url|basename }}"
+samplevnf_unarchive: "{{ samplevnf_file|regex_replace('[.]tar[.]gz$', '') }}"
+samplevnf_dest: "{{ clone_dest }}/"
+samplevnf_sha256: "sha256:36457cadfd23053c9ce1cf2e6f048cad6a5d04a7371d7a122e133dcbf007989e"
diff --git a/ansible/roles/download_samplevnfs/tasks/main.yml b/ansible/roles/download_samplevnfs/tasks/main.yml
new file mode 100644
index 000000000..005d57dda
--- /dev/null
+++ b/ansible/roles/download_samplevnfs/tasks/main.yml
@@ -0,0 +1,32 @@
+# 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.
+---
+#- debug:
+# var: samplevnf_version
+# verbosity: 2
+
+- name: fetch samplevnf
+ get_url:
+ url: "{{ samplevnf_url }}"
+ dest: "{{ samplevnf_dest }}"
+ validate_certs: False
+ checksum: "{{ samplevnf_sha256 }}"
+
+- unarchive:
+ src: "{{ clone_dest }}/{{ samplevnf_file }}"
+ dest: "{{ clone_dest }}/"
+ copy: no
+
+- set_fact:
+ samplevnf_path: "{{ clone_dest }}/{{ samplevnf_unarchive }}"
diff --git a/ansible/roles/download_trex/defaults/main.yml b/ansible/roles/download_trex/defaults/main.yml
new file mode 100644
index 000000000..dd2dd27eb
--- /dev/null
+++ b/ansible/roles/download_trex/defaults/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.
+---
+trex_version: v2.20
+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"
diff --git a/ansible/roles/download_trex/tasks/main.yml b/ansible/roles/download_trex/tasks/main.yml
new file mode 100644
index 000000000..75a3169f0
--- /dev/null
+++ b/ansible/roles/download_trex/tasks/main.yml
@@ -0,0 +1,25 @@
+# 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: fetch Trex
+ get_url:
+ url: "{{ trex_url }}"
+ dest: "{{ trex_dest }}"
+ checksum: "{{ trex_sha256 }}"
+
+- name: unarchive Trex
+ unarchive:
+ src: "{{ clone_dest }}/{{ trex_file }}"
+ dest: "{{ clone_dest }}/"
+ copy: no
diff --git a/ansible/roles/download_unixbench/defaults/main.yml b/ansible/roles/download_unixbench/defaults/main.yml
new file mode 100644
index 000000000..95fe07cdc
--- /dev/null
+++ b/ansible/roles/download_unixbench/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+unixbench_repo: "https://github.com/kdlucas/byte-unixbench.git"
+unixbench_version: master
+unixbench_dest: "{{ clone_dest }}/UnixBench" \ No newline at end of file
diff --git a/ansible/roles/download_unixbench/tasks/main.yml b/ansible/roles/download_unixbench/tasks/main.yml
new file mode 100644
index 000000000..f5550c952
--- /dev/null
+++ b/ansible/roles/download_unixbench/tasks/main.yml
@@ -0,0 +1,21 @@
+# 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.
+---
+- git:
+ repo: "{{ unixbench_repo }}"
+ dest: "{{ unixbench_dest }}"
+ version: "{{ unixbench_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
new file mode 100755
index 000000000..f258bb684
--- /dev/null
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
@@ -0,0 +1,59 @@
+# 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: check if hugepages are set by this role
+ command: "grep -o '{{ hugepage_param_regex }}' /etc/default/grub"
+ register: is_mine_huge
+ ignore_errors: True
+
+- name: check if hugepages are set by someone else
+ command: "grep -o 'default_hugepagesz=' /etc/default/grub"
+ register: is_huge
+ ignore_errors: True
+
+- fail:
+ msg: "Hugepages already set by someone else"
+ when: is_mine_huge.stdout == "" and is_huge.stdout != ""
+
+- name: use 16 for auto num_hugepages and 1G size
+ set_fact:
+ num_hugepages: 16
+ when: num_hugepages|default("auto") == "auto"
+
+- name: set hugepages in grub
+ lineinfile:
+ dest: /etc/default/grub
+ regexp: '{{ hugepage_param_regex }}'
+ 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 }}"
+ src: nodev
+ fstype: hugetlbfs
+ state: present
+
+- service:
+ name: procps
+ enabled: yes
diff --git a/ansible/roles/enable_hugepages_on_boot/vars/main.yml b/ansible/roles/enable_hugepages_on_boot/vars/main.yml
new file mode 100644
index 000000000..acdf02509
--- /dev/null
+++ b/ansible/roles/enable_hugepages_on_boot/vars/main.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.
+---
+hugepage_param_regex: '^GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX.*# added by hugepages role'
+hugepage_param: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}" # added by hugepages role'
+
+update_grub:
+ Debian: "update-grub2"
+ RedHat: "grub2-mkconfig -o /boot/grub2/grub.cfg"
+
+huge_pagesize_short:
+ 1024: "1G"
+ 2: "2M"
+
+hugetable_mount: /mnt/huge
diff --git a/ansible/roles/enable_hugepages_runtime/tasks/main.yml b/ansible/roles/enable_hugepages_runtime/tasks/main.yml
new file mode 100644
index 000000000..45e1860a6
--- /dev/null
+++ b/ansible/roles/enable_hugepages_runtime/tasks/main.yml
@@ -0,0 +1,32 @@
+# 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.
+---
+- write_string:
+ val: "{{ num_hugepages }}"
+ path: "/sys/kernel/mm/hugepages/hugepages-{{ huge_pagesize_kb[huge_pagesize_mb] }}/nr_hugepages"
+
+- name: create hugetables mount
+ file: path="{{ hugetable_mount }}" state=directory
+
+- name: mount hugetlbfs
+ mount:
+ name: "{{ hugetable_mount }}"
+ src: nodev
+ fstype: hugetlbfs
+ state: mounted
+
+- service:
+ name: procps
+ state: started
+ enabled: yes
diff --git a/ansible/roles/enable_hugepages_runtime/vars/main.yml b/ansible/roles/enable_hugepages_runtime/vars/main.yml
new file mode 100644
index 000000000..5e1678cbb
--- /dev/null
+++ b/ansible/roles/enable_hugepages_runtime/vars/main.yml
@@ -0,0 +1,6 @@
+---
+huge_pagesize_kb:
+ 1024: 1048576kB
+ 2: 2048kB
+
+hugetable_mount: /mnt/huge
diff --git a/ansible/roles/enable_igb_uio_on_boot/tasks/main.yml b/ansible/roles/enable_igb_uio_on_boot/tasks/main.yml
new file mode 100644
index 000000000..6fb5aaf6c
--- /dev/null
+++ b/ansible/roles/enable_igb_uio_on_boot/tasks/main.yml
@@ -0,0 +1,18 @@
+# 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: configure igb_uio to load on boot
+ copy:
+ content: 'uio\nigb_uio\n'
+ dest: /etc/modules-load.d/nsb.conf
diff --git a/ansible/roles/install_L4Replay/tasks/main.yml b/ansible/roles/install_L4Replay/tasks/main.yml
new file mode 100644
index 000000000..1401d1b13
--- /dev/null
+++ b/ansible/roles/install_L4Replay/tasks/main.yml
@@ -0,0 +1,9 @@
+---
+# there is no clean for L4Replay
+#- my_make: chdir="{{ vnf_build_dir }}/L4Replay" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
+
+- name: Building L4Replay VNF
+ my_make: chdir="{{ NSB_INSTALL_DIR }}/L4Replay" params="RTE_SDK={{ dpdk_path }}" extra_args="-j {{ ansible_processor_vcpus }}"
+
+- command: cp "{{ NSB_INSTALL_DIR }}/L4Replay/build/L4replay" "{{ INSTALL_BIN_PATH }}/"
+
diff --git a/ansible/roles/install_dependencies/tasks/Debian.yml b/ansible/roles/install_dependencies/tasks/Debian.yml
new file mode 100755
index 000000000..ac8332287
--- /dev/null
+++ b/ansible/roles/install_dependencies/tasks/Debian.yml
@@ -0,0 +1,49 @@
+# 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 core packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - python-minimal
+ - wget
+ - curl
+ - screen
+ - procps
+ - git
+ - socat
+ - sshpass
+ - libxslt1-dev
+ - libffi-dev
+ - libfuse-dev
+ - qemu-kvm
+ - qemu-user-static
+ - qemu-utils
+ - libvirt0
+ - python-libvirt
+ - bridge-utils
+ - ebtables
+ - openssl
+ - libssl-dev
+ - python-dev
+ - python-virtualenv
+ - ccze
+ - libxml2-dev
+ - libxslt-dev
+ - libzmq-dev
+ - nginx-full
+ - uwsgi
+ - uwsgi-plugin-python
+ - supervisor
+ - python-setuptools
+
diff --git a/ansible/roles/install_dependencies/tasks/RedHat.yml b/ansible/roles/install_dependencies/tasks/RedHat.yml
new file mode 100644
index 000000000..4bb7c318e
--- /dev/null
+++ b/ansible/roles/install_dependencies/tasks/RedHat.yml
@@ -0,0 +1,70 @@
+# 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 EPEL if needed
+ action: "{{ ansible_pkg_mgr }} name=epel-release state=present"
+ 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
+ - wget
+ - expect
+ - curl
+ # require python2 version of libselinux-python so ansible can operate in selinux enviroment
+ - libselinux-python
+ - screen
+ - git
+ - socat
+ #
+ - sshpass
+ - qemu-kvm
+ - qemu-img
+ - kpartx
+ - libxslt-devel
+ - libffi-devel
+ - openssl-devel
+ - zeromq2-devel
+ - nginx
+ - uwsgi
+ - uwsgi-plugin-python
+ - supervisor
+ - 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
diff --git a/ansible/roles/install_dependencies/tasks/main.yml b/ansible/roles/install_dependencies/tasks/main.yml
new file mode 100644
index 000000000..27660c3ca
--- /dev/null
+++ b/ansible/roles/install_dependencies/tasks/main.yml
@@ -0,0 +1,15 @@
+# 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: "{{ ansible_os_family }}.yml"
diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml
new file mode 100755
index 000000000..486d40e11
--- /dev/null
+++ b/ansible/roles/install_dpdk/tasks/Debian.yml
@@ -0,0 +1,19 @@
+# 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 DPDK build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - libpcap-dev
+
diff --git a/ansible/roles/install_dpdk/tasks/RedHat.yml b/ansible/roles/install_dpdk/tasks/RedHat.yml
new file mode 100644
index 000000000..af35c9b3e
--- /dev/null
+++ b/ansible/roles/install_dpdk/tasks/RedHat.yml
@@ -0,0 +1,19 @@
+# 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 DPDK build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - libpcap-devel
+
diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml
new file mode 100644
index 000000000..fca0e33af
--- /dev/null
+++ b/ansible/roles/install_dpdk/tasks/main.yml
@@ -0,0 +1,90 @@
+# 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.
+---
+#- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=0
+# with_fileglob:
+# - "{{ local_nsb_path }}/patches/dpdk_custom_patch/rte_pipeline.patch"
+#
+#- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=1
+# with_fileglob:
+# - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch"
+
+- include: "{{ ansible_os_family }}.yml"
+
+- my_make:
+ chdir: "{{ dpdk_path }}"
+ target: config
+ params:
+ T: "{{ dpdk_make_arch }}"
+ O: "{{ dpdk_make_arch }}"
+ extra_args: "-j {{ ansible_processor_vcpus }}"
+
+- name: enable RTE_PORT_STATS_COLLECT
+ lineinfile:
+ dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_PORT_STATS_COLLECT=n'
+ line: 'CONFIG_RTE_PORT_STATS_COLLECT=y'
+
+- name: enable DPDK RTE_PORT_PCAP
+ lineinfile:
+ dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_PORT_PCAP=n'
+ line: 'CONFIG_RTE_PORT_PCAP=y'
+
+- name: enable DPDK RTE_TABLE_STATS_COLLECT
+ lineinfile:
+ dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_TABLE_STATS_COLLECT=n'
+ line: 'CONFIG_RTE_TABLE_STATS_COLLECT=y'
+
+- name: enable DPDK RTE_PIPELINE_STATS_COLLECT
+ lineinfile:
+ dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
+ line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
+
+- my_make:
+ chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
+ extra_args: "-j {{ ansible_processor_vcpus }}"
+
+- file:
+ path: "{{ dpdk_module_dir}}"
+ state: directory
+
+- copy:
+ src: "{{ dpdk_path }}/{{ dpdk_make_arch }}/kmod/igb_uio.ko"
+ dest: "{{ dpdk_module_dir }}/igb_uio.ko"
+ remote_src: yes
+
+- command: depmod -a
+
+- file:
+ path: "{{ INSTALL_BIN_PATH }}"
+ state: directory
+
+- name: copy dpdk-devbind.py to correct location
+ copy:
+ src: "{{ dpdk_devbind[dpdk_version] }}"
+ dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py"
+ remote_src: yes
+ force: yes
+ mode: 0755
+
+- name: make dpdk_nic_bind.py for backwards compatibility
+ copy:
+ src: "{{ dpdk_devbind[dpdk_version] }}"
+ dest: "{{ INSTALL_BIN_PATH }}/dpdk_nic_bind.py"
+ remote_src: yes
+ force: yes
+ mode: 0755
diff --git a/ansible/roles/install_dpdk/vars/main.yml b/ansible/roles/install_dpdk/vars/main.yml
new file mode 100644
index 000000000..a226045f5
--- /dev/null
+++ b/ansible/roles/install_dpdk/vars/main.yml
@@ -0,0 +1,9 @@
+---
+dpdk_make_arch: x86_64-native-linuxapp-gcc
+dpdk_module_dir: "/lib/modules/{{ ansible_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
new file mode 100644
index 000000000..b1695e278
--- /dev/null
+++ b/ansible/roles/install_image_dependencies/defaults/main.yml
@@ -0,0 +1,46 @@
+---
+pkg_mgr_retries: 3
+epel_rpm_el7: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+
+install_dependencies:
+ Debian:
+ - bc
+ - fio
+ - git
+ - gcc
+ - iperf3
+ - ethtool
+ - iproute2
+ - linux-tools-common
+ - linux-tools-generic
+ - lmbench
+ - make
+ - netperf
+ - patch
+ - perl
+ - rt-tests
+ - stress
+ - sysstat
+ - unzip
+ # for Trex
+ - libpython2.7-dev
+ RedHat:
+ - bc
+ - fio
+ - git
+ - gcc
+ - iperf3
+ - ethtool
+ - iproute
+ - perf
+ - kernel-tools
+ - lmbench
+ - make
+ - netperf
+ - patch
+ - perl
+ - rt-tests
+ - stress
+ - sysstat
+ - unzip
+ - python-devel
diff --git a/ansible/roles/install_image_dependencies/tasks/Debian.yml b/ansible/roles/install_image_dependencies/tasks/Debian.yml
new file mode 100644
index 000000000..a54e115be
--- /dev/null
+++ b/ansible/roles/install_image_dependencies/tasks/Debian.yml
@@ -0,0 +1,15 @@
+# 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.
+---
+
diff --git a/ansible/roles/install_image_dependencies/tasks/RedHat.yml b/ansible/roles/install_image_dependencies/tasks/RedHat.yml
new file mode 100644
index 000000000..9f5cdce96
--- /dev/null
+++ b/ansible/roles/install_image_dependencies/tasks/RedHat.yml
@@ -0,0 +1,16 @@
+# 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 EPEL if needed
+ action: "{{ ansible_pkg_mgr }} name={{ epel_rpm_el7 }} state=present"
diff --git a/ansible/roles/install_image_dependencies/tasks/main.yml b/ansible/roles/install_image_dependencies/tasks/main.yml
new file mode 100644
index 000000000..33d99af06
--- /dev/null
+++ b/ansible/roles/install_image_dependencies/tasks/main.yml
@@ -0,0 +1,23 @@
+# 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: OS pre-workarounds
+ include: "{{ target_os_family }}.yml"
+
+ - name: Install core packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
+ register: pkg_mgr_results
+ retries: "{{ pkg_mgr_retries }}"
+ until: pkg_mgr_results|success
+ with_items: "{{ install_dependencies[target_os_family] }}"
diff --git a/ansible/roles/install_local_yardstick/tasks/main.yml b/ansible/roles/install_local_yardstick/tasks/main.yml
new file mode 100644
index 000000000..1a8227f8e
--- /dev/null
+++ b/ansible/roles/install_local_yardstick/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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: remove yardstick
+ pip: name=yardstick state=absent
+
+- name: install yardstack
+ pip: name="file://{{ YARDSTICK_REPO_DIR }}" state=forcereinstall
diff --git a/ansible/roles/install_prox/tasks/Debian.yml b/ansible/roles/install_prox/tasks/Debian.yml
new file mode 100755
index 000000000..00a31fc41
--- /dev/null
+++ b/ansible/roles/install_prox/tasks/Debian.yml
@@ -0,0 +1,24 @@
+# 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 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
diff --git a/ansible/roles/install_prox/tasks/RedHat.yml b/ansible/roles/install_prox/tasks/RedHat.yml
new file mode 100644
index 000000000..69fa83b31
--- /dev/null
+++ b/ansible/roles/install_prox/tasks/RedHat.yml
@@ -0,0 +1,22 @@
+# 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 PROX build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - pkgconfig
+ - lua-devel
+ - ncurses-devel
+ - libedit-devel
+
diff --git a/ansible/roles/install_prox/tasks/main.yml b/ansible/roles/install_prox/tasks/main.yml
new file mode 100644
index 000000000..93025fcb4
--- /dev/null
+++ b/ansible/roles/install_prox/tasks/main.yml
@@ -0,0 +1,30 @@
+# 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: "{{ 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 }}"
+
+
diff --git a/ansible/roles/install_ramspeed/tasks/main.yml b/ansible/roles/install_ramspeed/tasks/main.yml
new file mode 100644
index 000000000..c995661d7
--- /dev/null
+++ b/ansible/roles/install_ramspeed/tasks/main.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.
+---
+- file:
+ path: "{{ ramspeed_dest }}/{{ ramspeed_release }}/temp"
+ state: directory
+
+- file:
+ path: "{{ ramspeed_dest }}/{{ ramspeed_release }}/build.sh"
+ mode: 744
+- name: install ramspeed
+ command: "{{ ramspeed_dest }}/{{ ramspeed_release }}/build.sh"
+ args:
+ chdir: "{{ ramspeed_dest }}/{{ ramspeed_release }}"
+
diff --git a/ansible/roles/install_storperf/remove_storperf/tasks/main.yml b/ansible/roles/install_storperf/remove_storperf/tasks/main.yml
new file mode 100644
index 000000000..43e799239
--- /dev/null
+++ b/ansible/roles/install_storperf/remove_storperf/tasks/main.yml
@@ -0,0 +1,16 @@
+# 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: remove storperf
+ command: yardstick -d plugin remove plugin/CI/storperf.yaml \ No newline at end of file
diff --git a/ansible/roles/install_storperf/tasks/main.yml b/ansible/roles/install_storperf/tasks/main.yml
new file mode 100644
index 000000000..8a73d2932
--- /dev/null
+++ b/ansible/roles/install_storperf/tasks/main.yml
@@ -0,0 +1,16 @@
+# 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 storperf
+ command: yardstick -d plugin install plugin/CI/storperf.yaml \ No newline at end of file
diff --git a/ansible/roles/install_trex/defaults/main.yml b/ansible/roles/install_trex/defaults/main.yml
new file mode 100644
index 000000000..1b2876301
--- /dev/null
+++ b/ansible/roles/install_trex/defaults/main.yml
@@ -0,0 +1,17 @@
+# 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.
+---
+#TREX_DOWNLOAD: "https://trex-tgn.cisco.com/trex/release/v2.05.tar.gz"
+TREX_VERSION: v2.20
+TREX_DOWNLOAD: "{{ nsb_mirror_url|ternary(nsb_mirror_url, 'https://trex-tgn.cisco.com/trex/release' }}/{{ TREX_VERSION }}.tar.gz"
diff --git a/ansible/roles/install_trex/tasks/main.yml b/ansible/roles/install_trex/tasks/main.yml
new file mode 100644
index 000000000..4818a8087
--- /dev/null
+++ b/ansible/roles/install_trex/tasks/main.yml
@@ -0,0 +1,36 @@
+# 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:
+ 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 "{{ clone_dest }}/{{ trex_unarchive }}" "{{ INSTALL_BIN_PATH }}/trex/scripts"
+
+- file: path="{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl/__init__.py" state=touch
+
+# 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 }}"
+
+- name: add scripts to PYTHONPATH
+ lineinfile:
+ dest: /etc/environment
+ regexp: "^PYTHONPATH="
+ line: "PYTHONPATH={{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane:{{ INSTALL_BIN_PATH }}/trex/scripts/automation/trex_control_plane/stl"
+ state: present
+ create: yes
diff --git a/ansible/roles/install_unixbench/tasks/main.yml b/ansible/roles/install_unixbench/tasks/main.yml
new file mode 100644
index 000000000..46edc54a0
--- /dev/null
+++ b/ansible/roles/install_unixbench/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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 unixbench
+ make:
+ # extra subdir for UnixBench
+ chdir: "{{ unixbench_dest }}/UnixBench"
+ target: all
diff --git a/ansible/roles/install_vnf_vACL/tasks/main.yml b/ansible/roles/install_vnf_vACL/tasks/main.yml
new file mode 100644
index 000000000..ff2e769f0
--- /dev/null
+++ b/ansible/roles/install_vnf_vACL/tasks/main.yml
@@ -0,0 +1,41 @@
+# 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
new file mode 100644
index 000000000..ee61bf11c
--- /dev/null
+++ b/ansible/roles/install_vnf_vACL/vars/main.yml
@@ -0,0 +1,2 @@
+---
+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
new file mode 100644
index 000000000..9f8458f6f
--- /dev/null
+++ b/ansible/roles/install_vnf_vCGNAPT/tasks/main.yml
@@ -0,0 +1,41 @@
+# 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
new file mode 100644
index 000000000..cca1a89a3
--- /dev/null
+++ b/ansible/roles/install_vnf_vCGNAPT/vars/main.yml
@@ -0,0 +1,2 @@
+---
+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
new file mode 100644
index 000000000..cb3df3ed4
--- /dev/null
+++ b/ansible/roles/install_vnf_vFW/tasks/main.yml
@@ -0,0 +1,50 @@
+# 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
new file mode 100644
index 000000000..8a8a39865
--- /dev/null
+++ b/ansible/roles/install_vnf_vFW/vars/main.yml
@@ -0,0 +1,2 @@
+---
+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
new file mode 100644
index 000000000..91d449a41
--- /dev/null
+++ b/ansible/roles/install_vnf_vPE/tasks/main.yml
@@ -0,0 +1,37 @@
+# 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
new file mode 100644
index 000000000..fe0a9727f
--- /dev/null
+++ b/ansible/roles/install_vnf_vPE/vars/main.yml
@@ -0,0 +1,2 @@
+---
+vpe_build_dir: "{{ dpdk_path }}/examples/ip_pipeline" \ No newline at end of file
diff --git a/ansible/roles/load_igb_uio/tasks/main.yml b/ansible/roles/load_igb_uio/tasks/main.yml
new file mode 100644
index 000000000..d144ea4b7
--- /dev/null
+++ b/ansible/roles/load_igb_uio/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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: reload module dependencies
+ command: "depmod -a"
+
+- modprobe: name=uio state=present
+- modprobe: name=igb_uio state=present
diff --git a/ansible/roles/load_msr/tasks/main.yml b/ansible/roles/load_msr/tasks/main.yml
new file mode 100644
index 000000000..b8037bd4d
--- /dev/null
+++ b/ansible/roles/load_msr/tasks/main.yml
@@ -0,0 +1,19 @@
+# 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: load msr kernel module
+ modprobe:
+ name: msr
+ state: present
+
diff --git a/ansible/roles/modify_cloud_config/files/10_etc_hosts.cfg b/ansible/roles/modify_cloud_config/files/10_etc_hosts.cfg
new file mode 100644
index 000000000..84b5985f9
--- /dev/null
+++ b/ansible/roles/modify_cloud_config/files/10_etc_hosts.cfg
@@ -0,0 +1,4 @@
+manage_etc_hosts: True
+password: RANDOM
+chpasswd: { expire: False }
+ssh_pwauth: True
diff --git a/ansible/roles/modify_cloud_config/tasks/main.yml b/ansible/roles/modify_cloud_config/tasks/main.yml
new file mode 100644
index 000000000..39b82970a
--- /dev/null
+++ b/ansible/roles/modify_cloud_config/tasks/main.yml
@@ -0,0 +1,18 @@
+# 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: Allow console access via pwd
+ copy:
+ src: 10_etc_hosts.cfg
+ dest: /etc/cloud/cloud.cfg.d/10_etc_hosts.cfg
diff --git a/ansible/roles/reset_resolv_conf/tasks/main.yml b/ansible/roles/reset_resolv_conf/tasks/main.yml
new file mode 100644
index 000000000..50094f24f
--- /dev/null
+++ b/ansible/roles/reset_resolv_conf/tasks/main.yml
@@ -0,0 +1,29 @@
+# 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: Readlink on /etc/resolv.conf to find original file so we don't break image symlink
+ stat:
+ path: /etc/resolv.conf
+ register: resolv_conf_stat
+
+- name: pre-create resolv.conf sourc link dest
+ file:
+ path: "{{ resolv_conf_stat.stat.lnk_source|dirname }}"
+ state: directory
+ mode: 755
+
+- name: Override resolv.conf link source with specific nameserver
+ template:
+ src: resolv.conf.j2
+ dest: "{{ resolv_conf_stat.stat.lnk_source }}" \ No newline at end of file
diff --git a/ansible/roles/reset_resolv_conf/templates/resolv.conf.j2 b/ansible/roles/reset_resolv_conf/templates/resolv.conf.j2
new file mode 100644
index 000000000..b46460d43
--- /dev/null
+++ b/ansible/roles/reset_resolv_conf/templates/resolv.conf.j2
@@ -0,0 +1,4 @@
+nameserver {{ nameserver_ip }}
+nameserver 8.8.8.8
+nameserver 8.8.4.4
+
diff --git a/ansible/roles/set_package_installer_proxy/defaults/main.yml b/ansible/roles/set_package_installer_proxy/defaults/main.yml
new file mode 100644
index 000000000..9dcf3e9b6
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+connection_timeout: 600 \ No newline at end of file
diff --git a/ansible/roles/set_package_installer_proxy/tasks/Debian.yml b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
new file mode 100644
index 000000000..11117e5ed
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
@@ -0,0 +1,35 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * 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.
+#
+# 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.
+---
+ - name: Create apt.conf.d/ proxy config
+ template:
+ src: apt_conf.j2
+ dest: "/etc/apt/apt.conf.d/20proxy"
+
+ - name: Test proxy connection
+# async: "{{ connection_timeout }}"
+ action: "{{ ansible_pkg_mgr }} name=tar state=latest update_cache=yes"
+# 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
new file mode 100644
index 000000000..809e43a60
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
@@ -0,0 +1,57 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * 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.
+#
+# 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.
+---
+ # must do this before setting yum proxy
+ - name: find yum/dnf config
+ stat: "path={{ item }}"
+ register: packager_conf_stat
+ with_items:
+ - /etc/yum.conf
+ - /etc/dnf/dnf.conf
+
+ - name: insert yum/dnf proxy(http)
+ # insert after [main] section
+ lineinfile:
+ dest: "{{ item.stat.path }}"
+ state: present
+ regexp: "^proxy\\s*=\\s*{{ proxy_env.http_proxy }}"
+ insertafter: "^\\[main\\]"
+ line: "proxy={{ proxy_env.http_proxy }}"
+ when: '"http_proxy" in proxy_env and item.stat.isreg is defined and item.stat.isreg'
+ with_items: "{{ packager_conf_stat.results }}"
+
+ - name: verify proxy
+ command: "grep proxy= {{ item.stat.path }}"
+ when: 'item.stat.isreg is defined and item.stat.isreg'
+ 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
diff --git a/ansible/roles/set_package_installer_proxy/tasks/main.yml b/ansible/roles/set_package_installer_proxy/tasks/main.yml
new file mode 100644
index 000000000..9838cd489
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/tasks/main.yml
@@ -0,0 +1,40 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * 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.
+#
+# 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.
+---
+ - 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 }}"
diff --git a/ansible/roles/set_package_installer_proxy/templates/apt_conf.j2 b/ansible/roles/set_package_installer_proxy/templates/apt_conf.j2
new file mode 100644
index 000000000..5b57178a7
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/templates/apt_conf.j2
@@ -0,0 +1,3 @@
+{% if "http_proxy" in proxy_env %}
+Acquire::http::Proxy "{{ proxy_env.http_proxy }}";
+{% endif %}
diff --git a/ansible/roles/upload_images/tasks/main.yml b/ansible/roles/upload_images/tasks/main.yml
new file mode 100644
index 000000000..8629ee716
--- /dev/null
+++ b/ansible/roles/upload_images/tasks/main.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: upload images
+ os_image:
+ state: present
+ name: "{{ item.key }}"
+ is_public: true
+ disk_format: qcow2
+ container_format: bare
+ filename: "{{ local_images_dest }}/{{ item.value }}"
+ with_dict: "{{ yardstick_images }}"
+ environment: "{{ openrc }}"
+
+
diff --git a/ansible/run_yardstick_tests.yml b/ansible/run_yardstick_tests.yml
new file mode 100644
index 000000000..1490b8c55
--- /dev/null
+++ b/ansible/run_yardstick_tests.yml
@@ -0,0 +1,24 @@
+# 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: run yardstick tests
+ hosts: yardstick
+ vars_files:
+ - yardstick_config.yml
+
+ - role: install_storperf
+ when: "NODE_NAME == 'huawei-pod1'"
+# - run_test
+ - role: remove_storperf
+ when: "NODE_NAME == 'huawei-pod1'"
diff --git a/ansible/ubuntu_server_cloudimg_modify.yml b/ansible/ubuntu_server_cloudimg_modify.yml
new file mode 100644
index 000000000..950655ec8
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify.yml
@@ -0,0 +1,36 @@
+# 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:
+ # used to install the tools
+ clone_dir: /tmp/yardstick-clone
+
+ pre_tasks:
+ - debug: msg="chrooted in {{ inventory_hostname }}"
+
+ roles:
+ - reset_resolv_conf
+ - add_custom_repos
+ - modify_cloud_config
+ - install_image_dependencies
+ - download_unixbench
+ - install_unixbench
+ - download_ramspeed
+ - install_ramspeed
+ - download_cachestat
+ # there is no install for cachestat
+# - install_cachestat
+
diff --git a/ansible/ubuntu_server_cloudimg_modify_acl.yml b/ansible/ubuntu_server_cloudimg_modify_acl.yml
new file mode 100644
index 000000000..98542d7a3
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify_acl.yml
@@ -0,0 +1,41 @@
+# 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_vACL
+# - copy_L4Replay
+# - install_L4Replay
+ - copy_trex
+ - install_trex
+
diff --git a/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml b/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml
new file mode 100644
index 000000000..3f2a179bb
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify_cgnapt.yml
@@ -0,0 +1,41 @@
+# 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
new file mode 100644
index 000000000..2a087ce91
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify_dpdk.yml
@@ -0,0 +1,36 @@
+# 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
+ - enable_hugepages_on_boot
+ - modify_cloud_config
+ - install_image_dependencies
+ - download_unixbench
+ - install_unixbench
+ - download_ramspeed
+ - install_ramspeed
+ - download_cachestat
+ - install_cachestat
+ - download_dpdk
+ - install_dpdk
diff --git a/ansible/ubuntu_server_cloudimg_modify_vfw.yml b/ansible/ubuntu_server_cloudimg_modify_vfw.yml
new file mode 100644
index 000000000..f8cd3ecdc
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify_vfw.yml
@@ -0,0 +1,41 @@
+# 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/ubuntu_server_cloudimg_modify_vpe.yml b/ansible/ubuntu_server_cloudimg_modify_vpe.yml
new file mode 100644
index 000000000..f55a30fb9
--- /dev/null
+++ b/ansible/ubuntu_server_cloudimg_modify_vpe.yml
@@ -0,0 +1,41 @@
+# 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
+ # vPE is part of DPDK so we don't need to copy it
+ - install_vnf_vPE
+# - copy_L4Replay
+# - install_L4Replay
+# - copy_trex
+# - install_trex
+
diff --git a/ansible/yardstick_config.yml b/ansible/yardstick_config.yml
new file mode 100644
index 000000000..79ec1958e
--- /dev/null
+++ b/ansible/yardstick_config.yml
@@ -0,0 +1,40 @@
+# 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.
+---
+opnfv_root: /home/opnfv
+ # Can be any of 'bm' (Bare Metal) or 'virt' (Virtual)
+DEPLOY_TYPE: "{{ lookup('env', 'DEPLOY_TYPE')|default('bm', true) }}"
+NODE_NAME: "{{ lookup('env', 'NODE_NAME')|default('unknown', true) }}"
+EXTERNAL_NETWORK: "{{ lookup('env', 'EXTERNAL_NETWORK')|default('admin_floating_net', true)|attr('split')(';')|first }}"
+OPENRC: "{{ opnfv_root }}/openrc"
+INSTALLERS: [apex, compass, fuel, joid]
+INSTALLER_TYPE: "{{ lookup('env', 'INSTALLER_TYPE') }}"
+YARDSTICK_REPO_DIR: "{{ lookup('env', 'YARDSTICK_REPO_DIR')|default('/home/opnfv/repos/yardstick', true) }}"
+RELENG_REPO_DIR: "{{ lookup('env', 'RELENG_REPO_DIR')|default('/home/opnfv/repos/releng', true) }}"
+storperf_rc: "{{ opnfv_root }}/storperf_admin-rc"
+
+DISPATCHER_TYPES:
+ file:
+ DISPATCHER_FILE_NAME: "/tmp/yardstick.out"
+ DISPATCHER_HTTP_TARGET: "http://testresults.opnfv.org/test/api/v1/results"
+ DISPATCHER_INFLUXDB_TARGET: ""
+ http:
+ DISPATCHER_TYPE: http
+ DISPATCHER_HTTP_TARGET: "{{ dispatcher_target }}"
+ DISPATCHER_FILE_NAME: ""
+ influxdb:
+ DISPATCHER_TYPE: influxdb
+ DISPATCHER_INFLUXDB_TARGET: "{{ dispatcher_target }}"
+ DISPATCHER_FILE_NAME: ""
+
diff --git a/ansible/yardstick_verify.yml b/ansible/yardstick_verify.yml
new file mode 100644
index 000000000..d7932481c
--- /dev/null
+++ b/ansible/yardstick_verify.yml
@@ -0,0 +1,21 @@
+# 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: check_openstack.yml
+- include: install_yardstick.yml
+
+- include: clean_images.yml
+- include: load_images.yml
+
+- include: run_yardstick_tests.yml