summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/add_heat_stack_owner_role/tasks/main.yml2
-rw-r--r--ansible/roles/check_openstack_services/tasks/main.yml12
-rw-r--r--ansible/roles/clean_images/tasks/main.yml12
-rw-r--r--ansible/roles/convert_openrc/defaults/main.yml1
-rw-r--r--ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py167
-rw-r--r--ansible/roles/docker/defaults/main.yml15
-rw-r--r--ansible/roles/docker/handlers/main.yml20
-rw-r--r--ansible/roles/docker/tasks/Debian.yml26
-rw-r--r--ansible/roles/docker/tasks/RedHat.yml20
-rw-r--r--ansible/roles/docker/tasks/main.yml31
-rw-r--r--ansible/roles/docker/templates/RedHat-repos.j27
-rw-r--r--ansible/roles/docker/templates/http-proxy-conf.j22
-rw-r--r--ansible/roles/docker/vars/main.yml20
-rw-r--r--ansible/roles/download_civetweb/defaults/main.yml18
-rw-r--r--ansible/roles/download_civetweb/tasks/main.yml40
-rw-r--r--ansible/roles/download_collectd/defaults/main.yml4
-rw-r--r--ansible/roles/download_collectd/tasks/main.yml29
-rw-r--r--ansible/roles/download_intel_cmt_cat/defaults/main.yml4
-rw-r--r--ansible/roles/download_intel_cmt_cat/tasks/main.yml29
-rw-r--r--ansible/roles/download_pmu_tools/defaults/main.yml5
-rw-r--r--ansible/roles/download_pmu_tools/tasks/main.yml36
-rw-r--r--ansible/roles/download_samplevnfs/defaults/main.yml2
-rw-r--r--ansible/roles/enable_hugepages_on_boot/defaults/main.yml9
-rwxr-xr-xansible/roles/enable_hugepages_on_boot/tasks/main.yml11
-rw-r--r--ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml35
-rw-r--r--ansible/roles/increase_open_file_limits/defaults/main.yml15
-rw-r--r--ansible/roles/increase_open_file_limits/tasks/main.yml20
-rw-r--r--ansible/roles/install_L4Replay/tasks/main.yml9
-rw-r--r--ansible/roles/install_civetweb/defaults/main.yml21
-rw-r--r--ansible/roles/install_civetweb/tasks/main.yml22
-rw-r--r--ansible/roles/install_collectd/tasks/main.yml38
-rw-r--r--ansible/roles/install_collectd/vars/main.yml40
-rwxr-xr-xansible/roles/install_dependencies/tasks/Debian.yml2
-rwxr-xr-xansible/roles/install_dpdk/tasks/Debian.yml1
-rw-r--r--ansible/roles/install_dpdk/tasks/main.yml38
-rw-r--r--ansible/roles/install_dpdk/vars/main.yml1
-rw-r--r--ansible/roles/install_dpdk_shared/defaults/main.yml2
-rwxr-xr-xansible/roles/install_dpdk_shared/tasks/Debian.yml22
-rw-r--r--ansible/roles/install_dpdk_shared/tasks/RedHat.yml29
-rw-r--r--ansible/roles/install_dpdk_shared/tasks/main.yml114
-rw-r--r--ansible/roles/install_dpdk_shared/vars/main.yml9
-rw-r--r--ansible/roles/install_image_dependencies/defaults/main.yml5
-rw-r--r--ansible/roles/install_image_dependencies/tasks/main.yml2
-rw-r--r--ansible/roles/install_intel_cmt_cat/tasks/main.yml25
-rw-r--r--ansible/roles/install_intel_cmt_cat/vars/main.yml38
-rw-r--r--ansible/roles/install_pmu_tools/tasks/main.yml36
-rw-r--r--ansible/roles/install_pmu_tools/vars/main.yml38
-rw-r--r--ansible/roles/install_rabbitmq/tasks/main.yml22
-rw-r--r--ansible/roles/install_rabbitmq/templates/RedHat-repos.j221
-rw-r--r--ansible/roles/install_rabbitmq/vars/main.yml22
-rw-r--r--ansible/roles/install_samplevnf/tasks/main.yml13
-rw-r--r--ansible/roles/install_samplevnf/vars/main.yml17
-rwxr-xr-xansible/roles/package_clean/tasks/Debian.yml16
-rw-r--r--ansible/roles/package_clean/tasks/RedHat.yml17
-rw-r--r--ansible/roles/package_clean/tasks/main.yml15
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/Debian.yml35
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/RedHat.yml49
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/main.yml55
-rw-r--r--ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml11
59 files changed, 1089 insertions, 288 deletions
diff --git a/ansible/roles/add_heat_stack_owner_role/tasks/main.yml b/ansible/roles/add_heat_stack_owner_role/tasks/main.yml
index d751eb032..dda087998 100644
--- a/ansible/roles/add_heat_stack_owner_role/tasks/main.yml
+++ b/ansible/roles/add_heat_stack_owner_role/tasks/main.yml
@@ -19,6 +19,6 @@
role: heat_stack_owner
project: "{{ item }}"
with_items:
- - demo
+# - demo
- admin
environment: "{{ openrc }}"
diff --git a/ansible/roles/check_openstack_services/tasks/main.yml b/ansible/roles/check_openstack_services/tasks/main.yml
index 02e730533..bfd9e1193 100644
--- a/ansible/roles/check_openstack_services/tasks/main.yml
+++ b/ansible/roles/check_openstack_services/tasks/main.yml
@@ -13,13 +13,19 @@
# limitations under the License.
---
- name: Check images
- os_images_facts: {}
+ shade_api:
+ method: search_images
+ fact_name: openstack_images
+ args:
+ - ~
environment: "{{ openrc }}"
- name: Check servers
os_server_facts: {}
- environment: "{{ openrc }}"
+# environment: "{{ openrc }}"
- name: Check stacks
- os_stack_facts: {}
+ shade_api:
+ method: list_stacks
+ fact_name: openstack_stacks
environment: "{{ openrc }}"
diff --git a/ansible/roles/clean_images/tasks/main.yml b/ansible/roles/clean_images/tasks/main.yml
index 5cbae06d8..1bc3dc4ef 100644
--- a/ansible/roles/clean_images/tasks/main.yml
+++ b/ansible/roles/clean_images/tasks/main.yml
@@ -13,15 +13,21 @@
# limitations under the License.
---
- name: Get all images
- os_images_facts: {}
+ shade_api:
+ method: search_images
+ fact_name: openstack_images
+ args:
+ - ~
environment: "{{ openrc }}"
-- debug: var=openstack_images
+- 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
+- debug:
+ var: images_to_clean
- name: Cleanup images
os_image:
diff --git a/ansible/roles/convert_openrc/defaults/main.yml b/ansible/roles/convert_openrc/defaults/main.yml
index dffca1078..24a7129cc 100644
--- a/ansible/roles/convert_openrc/defaults/main.yml
+++ b/ansible/roles/convert_openrc/defaults/main.yml
@@ -12,6 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-openrc_file: "openrc"
cloud_yaml_path: "{{ playbook_dir }}/clouds.yaml"
diff --git a/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py b/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py
deleted file mode 100644
index debb8dd5b..000000000
--- a/ansible/roles/create_storperf_admin_rc/library/my_os_project_facts.py
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/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/docker/defaults/main.yml b/ansible/roles/docker/defaults/main.yml
new file mode 100644
index 000000000..e961969a4
--- /dev/null
+++ b/ansible/roles/docker/defaults/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.
+---
+ubuntu_docker_url: https://apt.dockerproject.org/repo
diff --git a/ansible/roles/docker/handlers/main.yml b/ansible/roles/docker/handlers/main.yml
new file mode 100644
index 000000000..5e6556031
--- /dev/null
+++ b/ansible/roles/docker/handlers/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: systemd daemon reload
+ command: systemctl daemon-reload
+
+ - name: restart docker
+ service: name=docker state=restarted
+
diff --git a/ansible/roles/docker/tasks/Debian.yml b/ansible/roles/docker/tasks/Debian.yml
new file mode 100644
index 000000000..cf4128774
--- /dev/null
+++ b/ansible/roles/docker/tasks/Debian.yml
@@ -0,0 +1,26 @@
+# Copyright (c) 2017 Intel Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+ - name: add Ubuntu docker repo
+ apt_repository: repo='deb [trusted=yes] {{ ubuntu_docker_url }} ubuntu-{{ ansible_distribution_release }} main' state=present
+
+ - name: ensure correct docker version
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: "{{ docker_packages[ansible_os_family] }}"
+
+ - name: remove Ubuntu docker repo
+ apt_repository:
+ repo: 'deb [trusted=yes] {{ ubuntu_docker_url }} ubuntu-{{ ansible_distribution_release }} main'
+ state: absent
+ update_cache: no
diff --git a/ansible/roles/docker/tasks/RedHat.yml b/ansible/roles/docker/tasks/RedHat.yml
new file mode 100644
index 000000000..2261da3de
--- /dev/null
+++ b/ansible/roles/docker/tasks/RedHat.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 Intel Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+ - name: bootstrap docker project repos
+ template: "src={{ ansible_os_family }}-repos.j2 dest=/etc/yum.repos.d/docker.repo"
+
+ - name: ensure correct docker version
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ docker_packages[ansible_os_family] }}"
diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml
new file mode 100644
index 000000000..bbec371a8
--- /dev/null
+++ b/ansible/roles/docker/tasks/main.yml
@@ -0,0 +1,31 @@
+# Copyright (c) 2017 Intel Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+ - name: Install docker
+ include: "{{ ansible_os_family }}.yml"
+
+ - name: create docker service config dir
+ file: path=/etc/systemd/system/docker.service.d state=directory
+
+ - name: create docker proxy config
+ template: src=http-proxy-conf.j2 dest=/etc/systemd/system/docker.service.d/http-proxy.conf owner=root mode=0644
+ when: 'proxy_env is defined and "http_proxy" in proxy_env or "https_proxy" in proxy_env'
+ notify:
+ - systemd daemon reload
+ - restart docker
+
+ - name: start docker service
+ service: name=docker state=started enabled=yes
+
+ - meta: flush_handlers
diff --git a/ansible/roles/docker/templates/RedHat-repos.j2 b/ansible/roles/docker/templates/RedHat-repos.j2
new file mode 100644
index 000000000..6d367408c
--- /dev/null
+++ b/ansible/roles/docker/templates/RedHat-repos.j2
@@ -0,0 +1,7 @@
+[dockerrepo]
+name=Docker Repository
+# $releasever for RHEL 7 is '7Server' so we can't use $releasever
+baseurl={{ docker_project_url }}/repo/main/{{ ansible_distribution|lower|regex_replace('redhat', 'centos') }}/{{ ansible_distribution_major_version }}/
+enabled=1
+gpgcheck=1
+gpgkey={{ docker_project_url }}/gpg
diff --git a/ansible/roles/docker/templates/http-proxy-conf.j2 b/ansible/roles/docker/templates/http-proxy-conf.j2
new file mode 100644
index 000000000..854ddfe09
--- /dev/null
+++ b/ansible/roles/docker/templates/http-proxy-conf.j2
@@ -0,0 +1,2 @@
+[Service]
+Environment={% if "http_proxy" in proxy_env %}"HTTP_PROXY={{ proxy_env.http_proxy }}" {% endif %} {% if "https_proxy" in proxy_env %} "HTTPS_PROXY={{ proxy_env.https_proxy }}" {% endif %} {% if "http_proxy" in proxy_env or "https_proxy" in proxy_env %} "NO_PROXY=localhost,127.0.0.0/8" {% endif %}
diff --git a/ansible/roles/docker/vars/main.yml b/ansible/roles/docker/vars/main.yml
new file mode 100644
index 000000000..8b5077490
--- /dev/null
+++ b/ansible/roles/docker/vars/main.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 Intel Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+docker_project_url: https://yum.dockerproject.org
+docker_packages:
+ "RedHat":
+ - docker-engine-1.13.1
+ "Debian":
+ - docker-engine=1.13.1*
diff --git a/ansible/roles/download_civetweb/defaults/main.yml b/ansible/roles/download_civetweb/defaults/main.yml
new file mode 100644
index 000000000..5efc9bb56
--- /dev/null
+++ b/ansible/roles/download_civetweb/defaults/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.
+---
+civetweb_url: https://sourceforge.net/projects/civetweb/files/1.9/CivetWeb_V1.9.zip
+civetweb_file: "{{ civetweb_url|basename }}"
+civetweb_dest: "{{ clone_dest }}/civetweb"
+civetweb_sha256s: "sha256:947a546bfccd733c79dff9565227fa74f4d17750650ff49312ef4b2d032fa8c8"
diff --git a/ansible/roles/download_civetweb/tasks/main.yml b/ansible/roles/download_civetweb/tasks/main.yml
new file mode 100644
index 000000000..03dd3ccd3
--- /dev/null
+++ b/ansible/roles/download_civetweb/tasks/main.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.
+---
+- name: fetch civetweb
+ get_url:
+ url: "{{ civetweb_url }}"
+ dest: "{{ clone_dest }}/"
+ validate_certs: False
+ checksum: "{{ civetweb_sha256s }}"
+
+- name: unarchive civetweb
+ unarchive:
+ src: "{{ clone_dest }}/{{ civetweb_file }}"
+ dest: "{{ clone_dest }}/"
+ copy: no
+
+- file:
+ path: "{{ civetweb_dest }}"
+ state: absent
+
+- name: "move civetweb to {{ civetweb_dest }} path"
+ shell: "mv {{ clone_dest }}/civetweb-master {{ civetweb_dest }}"
+ args:
+ executable: /bin/bash
+
+- name: cleanup zip file to save space
+ file:
+ path: "{{ clone_dest }}/{{ civetweb_file }}"
+ state: absent
diff --git a/ansible/roles/download_collectd/defaults/main.yml b/ansible/roles/download_collectd/defaults/main.yml
new file mode 100644
index 000000000..9beaeb897
--- /dev/null
+++ b/ansible/roles/download_collectd/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+collectd_url: "https://github.com/collectd/collectd.git"
+collectd_dest: "{{ clone_dest }}/collectd"
+collectd_version: "c870991a2d614e51c03c0da76e9aef997343551b"
diff --git a/ansible/roles/download_collectd/tasks/main.yml b/ansible/roles/download_collectd/tasks/main.yml
new file mode 100644
index 000000000..785cb3af5
--- /dev/null
+++ b/ansible/roles/download_collectd/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.
+---
+#- debug:
+# var: collectd_version
+# verbosity: 2
+
+- name: fetch collectd
+ git:
+ repo: "{{ collectd_url }}"
+ dest: "{{ collectd_dest }}"
+ version: "{{ collectd_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
+
+- set_fact:
+ collectd_path: "{{ collectd_dest }}"
diff --git a/ansible/roles/download_intel_cmt_cat/defaults/main.yml b/ansible/roles/download_intel_cmt_cat/defaults/main.yml
new file mode 100644
index 000000000..0c26770b9
--- /dev/null
+++ b/ansible/roles/download_intel_cmt_cat/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+intel_cmt_cat_url: "https://github.com/01org/intel-cmt-cat.git"
+intel_cmt_cat_dest: "{{ clone_dest }}/intel-cmt-cat"
+intel_cmt_cat_version: "v1.1.0"
diff --git a/ansible/roles/download_intel_cmt_cat/tasks/main.yml b/ansible/roles/download_intel_cmt_cat/tasks/main.yml
new file mode 100644
index 000000000..c1b6f7922
--- /dev/null
+++ b/ansible/roles/download_intel_cmt_cat/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.
+---
+#- debug:
+# var: intel_cmt_cat_version
+# verbosity: 2
+
+- name: fetch intel-cmt-cat
+ git:
+ repo: "{{ intel_cmt_cat_url }}"
+ dest: "{{ intel_cmt_cat_dest }}"
+ version: "{{ intel_cmt_cat_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
+
+- set_fact:
+ intel_cmt_cat_path: "{{ intel_cmt_cat_dest }}"
diff --git a/ansible/roles/download_pmu_tools/defaults/main.yml b/ansible/roles/download_pmu_tools/defaults/main.yml
new file mode 100644
index 000000000..3b164d1f9
--- /dev/null
+++ b/ansible/roles/download_pmu_tools/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+pmu_tools_url: "https://github.com/andikleen/pmu-tools.git"
+pmu_tools_dest: "{{ clone_dest }}/pmu-tools"
+pmu_tools_version: "8a0417a90c3ec9a09264ae9364519f499e8975c1"
+perfmon_url: "https://download.01.org/perfmon/"
diff --git a/ansible/roles/download_pmu_tools/tasks/main.yml b/ansible/roles/download_pmu_tools/tasks/main.yml
new file mode 100644
index 000000000..37375b668
--- /dev/null
+++ b/ansible/roles/download_pmu_tools/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: pmu_tools_version
+# verbosity: 2
+
+- name: fetch pmu_tools
+ git:
+ repo: "{{ pmu_tools_url }}"
+ dest: "{{ pmu_tools_dest }}"
+ version: "{{ pmu_tools_version }}"
+ accept_hostkey: yes
+ recursive: no
+ force: yes
+
+- set_fact:
+ pmu_tools_path: "{{ pmu_tools_dest }}"
+
+- name: Create perfmon local mirror
+ command: "wget -mkEpnp {{ perfmon_url }} -P {{ INSTALL_BIN_PATH }}/pmu_local_mirror"
+ ignore_errors: yes
+ failed_when: false #some of the links while creating mirror are not found, results in failure
+ no_log: True
+
diff --git a/ansible/roles/download_samplevnfs/defaults/main.yml b/ansible/roles/download_samplevnfs/defaults/main.yml
index 5f565a415..e40eb67c0 100644
--- a/ansible/roles/download_samplevnfs/defaults/main.yml
+++ b/ansible/roles/download_samplevnfs/defaults/main.yml
@@ -1,4 +1,4 @@
---
samplevnf_url: "https://git.opnfv.org/samplevnf"
samplevnf_dest: "{{ clone_dest }}/samplevnf"
-samplevnf_version: "master"
+samplevnf_version: "stable/euphrates"
diff --git a/ansible/roles/enable_hugepages_on_boot/defaults/main.yml b/ansible/roles/enable_hugepages_on_boot/defaults/main.yml
index 015e01bab..cc89ea346 100644
--- a/ansible/roles/enable_hugepages_on_boot/defaults/main.yml
+++ b/ansible/roles/enable_hugepages_on_boot/defaults/main.yml
@@ -1,3 +1,10 @@
---
num_hugepages: auto
-huge_pagesize_mb: 1024 \ No newline at end of file
+huge_pagesize_mb: 1024
+# disable EFI for chroot
+efi:
+ stat:
+ exists: False
+update_grub:
+ Debian: "grub-mkconfig -o {% if efi.stat.exists %}/boot/efi/EFI/{{ ansible_distribution|lower }}/grub.cfg{% else %}/boot/grub/grub.cfg{% endif %}"
+ RedHat: "grub2-mkconfig -o {% if efi.stat.exists %}/boot/efi/EFI/{{ ansible_distribution|lower }}/grub.cfg{% else %}/boot/grub2/grub.cfg{% endif %}"
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
index be4a328a2..29432d2e4 100755
--- a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
@@ -17,6 +17,11 @@
register: is_mine_huge
ignore_errors: True
+# won't work in chroot
+#- name: Detect EFI
+# stat: path="/sys/firmware/efi"
+# register: efi
+
- name: check if hugepages are set by someone else
command: "grep -o 'default_hugepagesz=' /etc/default/grub"
register: is_huge
@@ -28,7 +33,7 @@
- name: use 16 for auto num_hugepages and 1G size
set_fact:
- num_hugepages: 16
+ num_hugepages: 8
when: num_hugepages|default("auto") == "auto"
- name: set hugepages in grub
@@ -53,3 +58,7 @@
- service:
name: procps
enabled: yes
+
+- include: manual_modify_grub.yml
+ # only tested on Ubuntu, kernel line is probably different on other distros
+ when: ansible_distribution == "Ubuntu"
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml
new file mode 100644
index 000000000..cac10e80e
--- /dev/null
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml
@@ -0,0 +1,35 @@
+# 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: find boot grub.cfg
+ find:
+ paths: /boot
+ file_type: file
+ patterns: 'grub*.cfg'
+ recurse: yes
+ register: grub_files
+
+
+- name: added hugepages to grub manually because we can't run update-grub in chroot
+ replace:
+ dest: "{{ item.path }}"
+ # console= should end the line
+ regexp: '(linux\s+/boot/vmlinuz.*console=\S+$)'
+ # default_hugepagesz=1G hugepagesz=1G hugepages=8
+ replace: '\1 default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}'
+ with_items: "{{ grub_files.files }}"
+
+
+
+
diff --git a/ansible/roles/increase_open_file_limits/defaults/main.yml b/ansible/roles/increase_open_file_limits/defaults/main.yml
new file mode 100644
index 000000000..02cb12461
--- /dev/null
+++ b/ansible/roles/increase_open_file_limits/defaults/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.
+---
+open_file_limit: 500000
diff --git a/ansible/roles/increase_open_file_limits/tasks/main.yml b/ansible/roles/increase_open_file_limits/tasks/main.yml
new file mode 100644
index 000000000..4ef5e6f23
--- /dev/null
+++ b/ansible/roles/increase_open_file_limits/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: increase open file limits for control
+ pam_limits: "domain={{ item[0] }} limit_type={{ item[1] }} limit_item=nofile value={{ open_file_limit }}"
+ with_nested:
+ - [ '*', 'root' ]
+ - [ 'soft', 'hard' ]
+
diff --git a/ansible/roles/install_L4Replay/tasks/main.yml b/ansible/roles/install_L4Replay/tasks/main.yml
deleted file mode 100644
index 1401d1b13..000000000
--- a/ansible/roles/install_L4Replay/tasks/main.yml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-# 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_civetweb/defaults/main.yml b/ansible/roles/install_civetweb/defaults/main.yml
new file mode 100644
index 000000000..2235fe172
--- /dev/null
+++ b/ansible/roles/install_civetweb/defaults/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.
+---
+civetweb_dest: "{{ clone_dest }}/civetweb"
+civetweb_build_dependencies:
+ Debian:
+ - libjson0
+ - libjson0-dev
+ - libssl-dev
+ RedHat:
diff --git a/ansible/roles/install_civetweb/tasks/main.yml b/ansible/roles/install_civetweb/tasks/main.yml
new file mode 100644
index 000000000..67a910b83
--- /dev/null
+++ b/ansible/roles/install_civetweb/tasks/main.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 extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ civetweb_build_dependencies.get(ansible_os_family, []) }}"
+
+- name: Build civetweb lib
+ make:
+ chdir: "{{ civetweb_dest }}"
+ target: lib
diff --git a/ansible/roles/install_collectd/tasks/main.yml b/ansible/roles/install_collectd/tasks/main.yml
new file mode 100644
index 000000000..e3b655ffe
--- /dev/null
+++ b/ansible/roles/install_collectd/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.
+---
+- name: Install extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present update_cache=yes"
+ with_items: "{{ collectd_build_dependencies[ansible_os_family] }}"
+
+- name: prepare autotools
+ command: ./build.sh
+ args:
+ chdir: "{{ collectd_path }}"
+
+- name: build collectd
+ shell: "./configure --with-libpqos=/usr/ --with-libdpdk={{ dpdk_shared_path }} --with-libyajl=/usr/ --with-libjevents=/usr/local --enable-debug --enable-dpdkstat --enable-virt --enable-ovs_stats --enable-intel_pmu --prefix={{ INSTALL_BIN_PATH }}/collectd |& tee collectd-configure.txt"
+ args:
+ executable: /bin/bash
+ chdir: "{{ collectd_path }}"
+
+- fetch:
+ src: "{{ collectd_path }}/collectd-configure.txt"
+ dest: /tmp
+
+- name: "make collectd install"
+ make:
+ chdir: "{{ collectd_path }}"
+ target: install
+
diff --git a/ansible/roles/install_collectd/vars/main.yml b/ansible/roles/install_collectd/vars/main.yml
new file mode 100644
index 000000000..b1b3dc5db
--- /dev/null
+++ b/ansible/roles/install_collectd/vars/main.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.
+---
+collectd_build_dependencies:
+ Debian:
+ - flex
+ - bison
+ - build-essential
+ - pkg-config
+ - automake
+ - autotools-dev
+ - libltdl-dev
+ - librabbitmq-dev
+ - rabbitmq-server
+ - cmake
+ - libvirt-dev
+ - libyajl-dev
+ RedHat:
+ - flex
+ - bison
+ - pkgconfig
+ - automake
+ - cmake
+ - rabbitmq-server
+ - librabbitmq-devel
+ - libtool-ltdl-devel
+ - libvirt-devel
+ - yajl-devel
+
diff --git a/ansible/roles/install_dependencies/tasks/Debian.yml b/ansible/roles/install_dependencies/tasks/Debian.yml
index 0047a5e3b..bba6fb13c 100755
--- a/ansible/roles/install_dependencies/tasks/Debian.yml
+++ b/ansible/roles/install_dependencies/tasks/Debian.yml
@@ -47,4 +47,4 @@
- uwsgi-plugin-python
- supervisor
- python-setuptools
-
+ - lsof
diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml
index c77e4f96a..4f0c3c881 100755
--- a/ansible/roles/install_dpdk/tasks/Debian.yml
+++ b/ansible/roles/install_dpdk/tasks/Debian.yml
@@ -16,6 +16,7 @@
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- libpcap-dev
+ - pciutils
- name: Install kernel headers
action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml
index cab093ad5..01ad4baf1 100644
--- a/ansible/roles/install_dpdk/tasks/main.yml
+++ b/ansible/roles/install_dpdk/tasks/main.yml
@@ -36,13 +36,9 @@
set_fact:
RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
-- my_make:
+- command: make -j {{ ansible_processor_vcpus }} config T={{ dpdk_make_arch }} O={{ dpdk_make_arch }}
+ args:
chdir: "{{ dpdk_path }}"
- target: config
- params:
- T: "{{ dpdk_make_arch }}"
- O: "{{ dpdk_make_arch }}"
- extra_args: "-j {{ ansible_processor_vcpus }}"
environment:
RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
@@ -70,12 +66,38 @@
regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
-- my_make:
+# This is requied for collectd? but it breaks PROX?
+#- name: enable CONFIG_RTE_BUILD_SHARED_LIB
+# lineinfile:
+# dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+# regexp: '^CONFIG_RTE_BUILD_SHARED_LIB=n'
+# line: 'CONFIG_RTE_BUILD_SHARED_LIB=y'
+#
+#- name: enable DPDK CONFIG_RTE_EAL_PMD_PATH
+# lineinfile:
+# dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
+# regexp: '^CONFIG_RTE_EAL_PMD_PATH=""'
+# line: 'CONFIG_RTE_EAL_PMD_PATH="{{ dpdk_pmd_path }}"'
+
+# TODO: disable ASLR
+
+- name: make dpdk
+ command: make -j {{ ansible_processor_vcpus }}
+ args:
chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
- extra_args: "-j {{ ansible_processor_vcpus }}"
environment:
RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+#- name: make install DPDK into /usr for collectd and other programs
+# make:
+# chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
+# target: install
+# params: "T={{ RTE_TARGET }}"
+## params: "prefix={{ usr_prefix }}"
+# environment:
+# RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+# become: yes
+
- file:
path: "{{ dpdk_module_dir}}"
state: directory
diff --git a/ansible/roles/install_dpdk/vars/main.yml b/ansible/roles/install_dpdk/vars/main.yml
index 1cc4f1583..45bcc339b 100644
--- a/ansible/roles/install_dpdk/vars/main.yml
+++ b/ansible/roles/install_dpdk/vars/main.yml
@@ -6,3 +6,4 @@ 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"
+dpdk_pmd_path: /usr/lib/dpdk-pmd/
diff --git a/ansible/roles/install_dpdk_shared/defaults/main.yml b/ansible/roles/install_dpdk_shared/defaults/main.yml
new file mode 100644
index 000000000..fe2172401
--- /dev/null
+++ b/ansible/roles/install_dpdk_shared/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+INSTALL_BIN_PATH: "/opt/nsb_bin" \ No newline at end of file
diff --git a/ansible/roles/install_dpdk_shared/tasks/Debian.yml b/ansible/roles/install_dpdk_shared/tasks/Debian.yml
new file mode 100755
index 000000000..c77e4f96a
--- /dev/null
+++ b/ansible/roles/install_dpdk_shared/tasks/Debian.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 DPDK build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - libpcap-dev
+
+- name: Install kernel headers
+ action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
+
diff --git a/ansible/roles/install_dpdk_shared/tasks/RedHat.yml b/ansible/roles/install_dpdk_shared/tasks/RedHat.yml
new file mode 100644
index 000000000..ae66faa04
--- /dev/null
+++ b/ansible/roles/install_dpdk_shared/tasks/RedHat.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: Install DPDK build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items:
+ - libpcap-devel
+
+# Do this before installing kernel headers
+# example:
+# kernel-headers-3.10.0-514.2.2.el7.x86_64 for kernel 3.10.0-514.el7.x86_64
+- name: Adjust dpdk_kernel to be match an RPM, remove el7.x86_64
+ set_fact:
+ rpm_kernel: "{{ dpdk_kernel|regex_replace('[.]el\\d+\\.x86_64', '') }}"
+
+- name: Install kernel headers
+# use rpm wildcard
+ action: "{{ ansible_pkg_mgr }} name=kernel-headers-{{ rpm_kernel }}* state=present"
diff --git a/ansible/roles/install_dpdk_shared/tasks/main.yml b/ansible/roles/install_dpdk_shared/tasks/main.yml
new file mode 100644
index 000000000..65954be04
--- /dev/null
+++ b/ansible/roles/install_dpdk_shared/tasks/main.yml
@@ -0,0 +1,114 @@
+# 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"
+
+- name: set DPDK shared dir
+ set_fact:
+ dpdk_shared_path: "{{ dpdk_path }}-shared"
+
+- command: "cp -a {{ dpdk_path }} {{ dpdk_shared_path }}"
+
+- name: find kernel for image, (including chroot)
+ find_kernel:
+ kernel: "{{ ansible_kernel }}"
+ register: found_kernel
+
+# Do this before installing kernel headers
+- name: Set dpdk_kernel to be the kernel we found
+ set_fact:
+ dpdk_kernel: "{{ found_kernel.kernel }}"
+
+- include: "{{ ansible_os_family }}.yml"
+
+- name: set RTE_KERNELDIR to point to found kernel
+ set_fact:
+ RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
+
+- command: make -j {{ ansible_processor_vcpus }} config T={{ dpdk_make_arch }} O={{ dpdk_make_arch }}
+ args:
+ chdir: "{{ dpdk_shared_path }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+
+- name: enable RTE_PORT_STATS_COLLECT
+ lineinfile:
+ dest: "{{ dpdk_shared_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_shared_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_shared_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_shared_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
+ line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
+
+# This is requied for collectd but VNFs can't use shared DPDK
+- name: enable CONFIG_RTE_BUILD_SHARED_LIB
+ lineinfile:
+ dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_BUILD_SHARED_LIB=n'
+ line: 'CONFIG_RTE_BUILD_SHARED_LIB=y'
+
+- name: enable DPDK CONFIG_RTE_EAL_PMD_PATH
+ lineinfile:
+ dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
+ regexp: '^CONFIG_RTE_EAL_PMD_PATH=""'
+ line: 'CONFIG_RTE_EAL_PMD_PATH="{{ dpdk_pmd_path }}"'
+
+ # no T= target for clean
+- command: make -j {{ ansible_processor_vcpus }} clean O={{ dpdk_make_arch }}
+ args:
+ chdir: "{{ dpdk_shared_path }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+
+# TODO: disable ASLR
+
+- command: make -j {{ ansible_processor_vcpus }}
+ args:
+ chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+
+#- name: make install DPDK into /usr for collectd and other programs
+# make:
+# chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
+# target: install
+# params: "T={{ RTE_TARGET }}"
+## params: "prefix={{ usr_prefix }}"
+# environment:
+# RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
+# become: yes
+
+# don't install module or copy dpdk-devbind
+
diff --git a/ansible/roles/install_dpdk_shared/vars/main.yml b/ansible/roles/install_dpdk_shared/vars/main.yml
new file mode 100644
index 000000000..45bcc339b
--- /dev/null
+++ b/ansible/roles/install_dpdk_shared/vars/main.yml
@@ -0,0 +1,9 @@
+---
+dpdk_make_arch: x86_64-native-linuxapp-gcc
+dpdk_module_dir: "/lib/modules/{{ dpdk_kernel }}/extra"
+hugetable_mount: /mnt/huge
+dpdk_devbind:
+ "16.07": "{{ dpdk_path }}/tools/dpdk-devbind.py"
+ "17.02": "{{ dpdk_path }}/usertools/dpdk-devbind.py"
+ "17.04": "{{ dpdk_path }}/usertools/dpdk-devbind.py"
+dpdk_pmd_path: /usr/lib/dpdk-pmd/
diff --git a/ansible/roles/install_image_dependencies/defaults/main.yml b/ansible/roles/install_image_dependencies/defaults/main.yml
index b1695e278..362fa351b 100644
--- a/ansible/roles/install_image_dependencies/defaults/main.yml
+++ b/ansible/roles/install_image_dependencies/defaults/main.yml
@@ -13,9 +13,7 @@ install_dependencies:
- iproute2
- linux-tools-common
- linux-tools-generic
- - lmbench
- make
- - netperf
- patch
- perl
- rt-tests
@@ -24,6 +22,9 @@ install_dependencies:
- unzip
# for Trex
- libpython2.7-dev
+ # for IxLoad
+ - libxft-dev
+ - libxss-dev
RedHat:
- bc
- fio
diff --git a/ansible/roles/install_image_dependencies/tasks/main.yml b/ansible/roles/install_image_dependencies/tasks/main.yml
index f3a3151c5..ffd30f33e 100644
--- a/ansible/roles/install_image_dependencies/tasks/main.yml
+++ b/ansible/roles/install_image_dependencies/tasks/main.yml
@@ -16,7 +16,7 @@
include: "{{ ansible_os_family }}.yml"
- name: Install core packages
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest update_cache=yes"
register: pkg_mgr_results
retries: "{{ pkg_mgr_retries }}"
until: pkg_mgr_results|success
diff --git a/ansible/roles/install_intel_cmt_cat/tasks/main.yml b/ansible/roles/install_intel_cmt_cat/tasks/main.yml
new file mode 100644
index 000000000..609e98024
--- /dev/null
+++ b/ansible/roles/install_intel_cmt_cat/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: Install extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ intel_cmt_cat_build_dependencies[ansible_os_family] }}"
+
+- name: "make intel-cmt-cat"
+ make:
+ chdir: "{{ intel_cmt_cat_path }}"
+ target: install
+ params:
+ PREFIX: "/usr"
diff --git a/ansible/roles/install_intel_cmt_cat/vars/main.yml b/ansible/roles/install_intel_cmt_cat/vars/main.yml
new file mode 100644
index 000000000..20bc1c69c
--- /dev/null
+++ b/ansible/roles/install_intel_cmt_cat/vars/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.
+---
+intel_cmt_cat_build_dependencies:
+ Debian:
+ - flex
+ - bison
+ - build-essential
+ - pkg-config
+ - automake
+ - autotools-dev
+ - libltdl-dev
+ - librabbitmq-dev
+ - rabbitmq-server
+ - cmake
+ - libvirt-dev
+ RedHat:
+ - flex
+ - bison
+ - pkgconfig
+ - automake
+ - cmake
+ - rabbitmq-server
+ - librabbitmq-devel
+ - libtool-ltdl-devel
+ - libvirt-devel
+
diff --git a/ansible/roles/install_pmu_tools/tasks/main.yml b/ansible/roles/install_pmu_tools/tasks/main.yml
new file mode 100644
index 000000000..026fb67ea
--- /dev/null
+++ b/ansible/roles/install_pmu_tools/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.
+---
+
+- name: Install extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ pmu_tools_build_dependencies[ansible_os_family] }}"
+
+- name: fix pmu-tools CFLAGS to include -fPIC
+ replace:
+ path: "{{ pmu_tools_path }}/jevents/Makefile"
+ regexp: "CFLAGS := -g -Wall -O2 -Wno-unused-result"
+ replace: "CFLAGS := -g -Wall -O2 -Wno-unused-result -fPIC"
+ backup: yes
+
+- name: "make jevents"
+ make:
+ chdir: "{{ pmu_tools_path }}/jevents"
+
+- name: "make install jevents"
+ make:
+ chdir: "{{ pmu_tools_path }}/jevents"
+ target: install
+ become: yes
+
diff --git a/ansible/roles/install_pmu_tools/vars/main.yml b/ansible/roles/install_pmu_tools/vars/main.yml
new file mode 100644
index 000000000..10660f61b
--- /dev/null
+++ b/ansible/roles/install_pmu_tools/vars/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.
+---
+pmu_tools_build_dependencies:
+ Debian:
+ - flex
+ - bison
+ - build-essential
+ - pkg-config
+ - automake
+ - autotools-dev
+ - libltdl-dev
+ - librabbitmq-dev
+ - rabbitmq-server
+ - cmake
+ - libvirt-dev
+ RedHat:
+ - flex
+ - bison
+ - pkgconfig
+ - automake
+ - cmake
+ - rabbitmq-server
+ - librabbitmq-devel
+ - libtool-ltdl-devel
+ - libvirt-devel
+
diff --git a/ansible/roles/install_rabbitmq/tasks/main.yml b/ansible/roles/install_rabbitmq/tasks/main.yml
new file mode 100644
index 000000000..16195c49d
--- /dev/null
+++ b/ansible/roles/install_rabbitmq/tasks/main.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: bootstrap rabbitmq project repos
+ template: "src={{ ansible_os_family }}-repos.j2 dest=/etc/yum.repos.d/rabbitmq_rabbitmq-server.repo"
+ when: ansible_os_family == 'RedHat'
+
+- name: Install extra build dependencies
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest update_cache=yes"
+ with_items: "{{ rabbitmq_packages[ansible_os_family] }}"
+
diff --git a/ansible/roles/install_rabbitmq/templates/RedHat-repos.j2 b/ansible/roles/install_rabbitmq/templates/RedHat-repos.j2
new file mode 100644
index 000000000..09c997ce1
--- /dev/null
+++ b/ansible/roles/install_rabbitmq/templates/RedHat-repos.j2
@@ -0,0 +1,21 @@
+[rabbitmq_rabbitmq-server]
+name=rabbitmq_rabbitmq-server
+baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/{{ ansible_distribution_major_version }}/$basearch
+repo_gpgcheck=0
+gpgcheck=0
+enabled=1
+gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
+sslverify=0
+sslcacert=/etc/pki/tls/certs/ca-bundle.crt
+metadata_expire=300
+
+[rabbitmq_rabbitmq-server-source]
+name=rabbitmq_rabbitmq-server-source
+baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/{{ ansible_distribution_major_version }}/SRPMS
+repo_gpgcheck=0
+gpgcheck=0
+enabled=1
+gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
+sslverify=0
+sslcacert=/etc/pki/tls/certs/ca-bundle.crt
+metadata_expire=300 \ No newline at end of file
diff --git a/ansible/roles/install_rabbitmq/vars/main.yml b/ansible/roles/install_rabbitmq/vars/main.yml
new file mode 100644
index 000000000..d49607dbf
--- /dev/null
+++ b/ansible/roles/install_rabbitmq/vars/main.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.
+---
+rabbitmq_packages:
+ Debian:
+ - librabbitmq-dev
+ - rabbitmq-server
+ RedHat:
+ - rabbitmq-server
+ - librabbitmq-devel
+
diff --git a/ansible/roles/install_samplevnf/tasks/main.yml b/ansible/roles/install_samplevnf/tasks/main.yml
index d332c88bc..b5d33f668 100644
--- a/ansible/roles/install_samplevnf/tasks/main.yml
+++ b/ansible/roles/install_samplevnf/tasks/main.yml
@@ -22,7 +22,6 @@
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: "{{ vnf_build_dependencies.get(vnf_name, {}).get(ansible_os_family, []) }}"
-
- name: set build env vars
set_fact:
build_env_vars:
@@ -30,17 +29,21 @@
RTE_TARGET: "{{ RTE_TARGET }}"
VNF_CORE: "{{ samplevnf_path }}"
-- name: set soft CRC for PROX when building in VM
+- name: set soft CRC and GEN_DECAP_IPV6_TO_IPV4_CKSUM for PROX when building in VM
set_fact:
- build_env_vars: "{{ build_env_vars|combine({'crc': 'soft'}) }}"
+ build_env_vars: "{{ build_env_vars|combine({'crc': 'soft'})|combine({'GEN_DECAP_IPV6_TO_IPV4_CKSUM':'y'}) }}"
when: vnf_name == "PROX" and image_type is defined and image_type == "vm"
- name: "make {{ vnf_name }} clean"
- my_make: chdir="{{ vnf_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
+ command: make -j {{ ansible_processor_vcpus }} clean
+ args:
+ chdir: "{{ vnf_build_dir }}"
environment: "{{ build_env_vars }}"
- name: "make {{ vnf_name }}"
- my_make: chdir="{{ vnf_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
+ command: make -j {{ ansible_processor_vcpus }}
+ args:
+ chdir: "{{ vnf_build_dir }}"
environment: "{{ build_env_vars }}"
#- command: cp "{{ vnf_build_dir }}/{{ vnf_name }}/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vACL_vnf"
diff --git a/ansible/roles/install_samplevnf/vars/main.yml b/ansible/roles/install_samplevnf/vars/main.yml
index 6f2c44a84..45cea6820 100644
--- a/ansible/roles/install_samplevnf/vars/main.yml
+++ b/ansible/roles/install_samplevnf/vars/main.yml
@@ -15,6 +15,23 @@
vnf_build_dependencies:
PROX:
Debian:
+ - build-essential
+ - git
+ - unzip
+ - libpcap0.8-dev
+ - gcc
+ - make
+ - libc6
+ - libc6-dev
+ - g++-multilib
+ - libzmq3-dev
+ - libcurl4-openssl-dev
+ - net-tools
+ - wget
+ - libpcap-dev
+ - libncurses-dev
+ - libedit-dev
+ - pciutils
- pkg-config
- liblua5.2-dev
- libncurses5
diff --git a/ansible/roles/package_clean/tasks/Debian.yml b/ansible/roles/package_clean/tasks/Debian.yml
new file mode 100755
index 000000000..abc280076
--- /dev/null
+++ b/ansible/roles/package_clean/tasks/Debian.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: Purge apt cache
+ command: apt-get clean
diff --git a/ansible/roles/package_clean/tasks/RedHat.yml b/ansible/roles/package_clean/tasks/RedHat.yml
new file mode 100644
index 000000000..c6ed62b35
--- /dev/null
+++ b/ansible/roles/package_clean/tasks/RedHat.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.
+---
+- name: Clean yum cache
+ command: "{{ ansible_pkg_mgr }} clean all
+
diff --git a/ansible/roles/package_clean/tasks/main.yml b/ansible/roles/package_clean/tasks/main.yml
new file mode 100644
index 000000000..27660c3ca
--- /dev/null
+++ b/ansible/roles/package_clean/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/set_package_installer_proxy/tasks/Debian.yml b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
index 11117e5ed..d3891ab18 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/Debian.yml
@@ -1,27 +1,16 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
---
- name: Create apt.conf.d/ proxy config
template:
@@ -29,7 +18,7 @@
dest: "/etc/apt/apt.conf.d/20proxy"
- name: Test proxy connection
-# async: "{{ connection_timeout }}"
+ async: "{{ connection_timeout }}"
action: "{{ ansible_pkg_mgr }} name=tar state=latest update_cache=yes"
-# poll: 0
+ poll: 0
register: test_proxy_job_id
diff --git a/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml b/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
index 809e43a60..1c3e9fb0f 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/RedHat.yml
@@ -1,27 +1,16 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
---
# must do this before setting yum proxy
- name: find yum/dnf config
@@ -48,10 +37,14 @@
with_items: "{{ packager_conf_stat.results }}"
register: yum_proxy_lines
-# - name: Test proxy connection
-# # try workaround call makecache directly
-# # yum module was failing for some reason
-# async: "{{ connection_timeout }}"
-# command: "{{ ansible_pkg_mgr }} -d2 -y makecache"
-# poll: 0
-# register: test_proxy_job_id
+ - name: yum disable fastest mirrors
+ include: yum_disable_fastestmirrors.yml
+ when: ansible_pkg_mgr == 'yum'
+
+ - name: Test proxy connection
+ # try workaround call makecache directly
+ # yum module was failing for some reason
+ async: "{{ connection_timeout }}"
+ command: "{{ ansible_pkg_mgr }} -d2 -y makecache"
+ poll: 0
+ register: test_proxy_job_id
diff --git a/ansible/roles/set_package_installer_proxy/tasks/main.yml b/ansible/roles/set_package_installer_proxy/tasks/main.yml
index 9838cd489..fea424bf3 100644
--- a/ansible/roles/set_package_installer_proxy/tasks/main.yml
+++ b/ansible/roles/set_package_installer_proxy/tasks/main.yml
@@ -1,40 +1,29 @@
-# Copyright (c) 2016, Intel Corporation.
+# Copyright (c) 2016-2017 Intel Corporation
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Intel Corporation nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
---
- name: Configure package manager proxy
include: "{{ ansible_os_family }}.yml"
-# - async_status: jid={{ test_proxy_job_id.ansible_job_id }}
-# register: test_proxy_result
-# until: test_proxy_result.finished
-# retries: 60
-# delay: 10
-#
-# - debug: var=hostvars[item]['test_proxy_result']
-# with_items: "{{ hostvars }}"
-#
-# - name: Verify proxy test
-# fail: msg="proxy test timeout"
-# when: "{{ test_proxy_result.get('finished', 0) == 0 }}"
+ - async_status: jid={{ test_proxy_job_id.ansible_job_id }}
+ register: test_proxy_result
+ until: test_proxy_result.finished
+ retries: 60
+ delay: 10
+
+ - debug: var=hostvars[item]['test_proxy_result']
+ with_items: "{{ hostvars }}"
+
+ - name: Verify proxy test
+ fail: msg="proxy test timeout"
+ when: "test_proxy_result.get('finished', 0) == 0"
diff --git a/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml b/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml
new file mode 100644
index 000000000..42388bcd9
--- /dev/null
+++ b/ansible/roles/set_package_installer_proxy/tasks/yum_disable_fastestmirrors.yml
@@ -0,0 +1,11 @@
+---
+ - name: yum disable fastest mirrors
+ lineinfile:
+ dest: "/etc/yum/pluginconf.d/fastestmirror.conf"
+ regexp: "^enabled=1"
+ line: "enabled=0"
+ ignore_errors: true
+
+ - name: yum clean all
+ command: yum clean all
+