- set CIMC address
- set CIMC username, password and hostname
+- set IPMI address
+- set IPMI username, password and hostname
### Bootstrap the host
-From PXE boostrap server:
+Optional: From PXE boostrap server in case of installing Haswell
- - `cd ~testuser/host-setup/cimc`
+ - `cd resources/tools/testbed-setup/cimc`
- Initialize args.ip: Power-Off, reset BIOS defaults, Enable console redir, get LOM MAC addr
- `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -i`
- Adjust BIOS settings
- Reboot server with boot from PXE (restart immediately)
- `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -pxe`
-While Ubuntu install is running:
+Optional: If RAID is not created on Haswells. Execute while Ubuntu install is running
- create RAID array. Reboot if needed.
- `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d --wipe`
- Set the next boot from HDD (without restart)
- `./cimc.py -u admin -p Cisco1234 $CIMC_ADDRESS -d -hdd`
-When installation is finished:
-
- - `ssh-copy-id 10.30.51.x`
- - `cd ~testuser/host-setup/playbooks`
- - edit /etc/ansible/hosts; add the hosts you are installing. *REMOVE ANY HOSTS YOU ARE NOT CURRENTLY INSTALLING*.
-
- Example for physical testbed hosts:
- ~~~
- [tg]
- 10.30.51.24 hostname=t3-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-
- [sut]
- 10.30.51.25 hostname=t3-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
- 10.30.51.26 hostname=t3-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
- ~~~
+Optional: If installing Skylake machine, connect to IPMI and boot from PXE via F12
- Example for VIRL hosts -- use the "virl" tag and specify the flat network start and end addresses:
-
- ~~~
- [virl]
- 10.30.51.28 hostname=t4-virl1 virl_l2_start=10.30.52.2 virl_l2_end=10.30.52.253 virl_l2_network=10.30.52.0/24 virl_l2_ip=10.30.52.254 virl_public_port=eth0
- ~~~
+When installation is finished:
- - `ansible-playbook --ask-sudo-pass 01-host-setup.yaml`
- - `ansible-playbook reboot.yaml`
+ - Copy ssh keys for no pass access: `ssh-copy-id 10.30.51.x`
+ - Clone CSIT actual repo: `git clone https://gerrit.fd.io/r/csit`
+ - Go to ansible directory: `cd csit/resources/tools/testbed-setup/ansible`
+ - Edit production file and uncomment servers that are supposed to be installed: `ansible-playbook --ask-become-pass --inventory production site.yaml --list-hosts`
+ - Run ansible on selected hosts: `ansible-playbook --ask-become-pass --inventory production site.yaml`
For non-VIRL hosts, stop here.
-
### VIRL installation
After the host has rebooted:
--- /dev/null
+---
+# file: group_vars/all.yaml
+
+ansible_python_interpreter: "/usr/bin/python2.7"
--- /dev/null
+---
+# file: group_vars/haswell/sut.yaml
+
+isolcpus: "1-17,19-35"
--- /dev/null
+---
+# file: group_vars/haswell/tg.yaml
+
+isolcpus: "1-17,19-35"
--- /dev/null
+---
+# file: group_vars/skylake/sut.yaml
+
+isolcpus: "1-27,29-55,57-83,85-111"
--- /dev/null
+---
+# file: group_vars/skylake/tg.yaml
+
+isolcpus: "1-27,29-55,57-83,85-111"
--- /dev/null
+---
+# file: host_vars/10.30.51.16.yaml
+
+hostname: "t1-tg1"
--- /dev/null
+---
+# file: host_vars/10.30.51.17.yaml
+
+hostname: "t1-sut1"
--- /dev/null
+---
+# file: host_vars/10.30.51.18.yaml
+
+hostname: "t1-sut2"
--- /dev/null
+---
+# file: host_vars/10.30.51.20.yaml
+
+hostname: "t2-tg1"
--- /dev/null
+---
+# file: host_vars/10.30.51.21.yaml
+
+hostname: "t2-sut1"
--- /dev/null
+---
+# file: host_vars/10.30.51.22.yaml
+
+hostname: "t2-sut2"
--- /dev/null
+---
+# file: host_vars/10.30.51.24.yaml
+
+hostname: "t3-tg1"
--- /dev/null
+---
+# file: host_vars/10.30.51.25.yaml
+
+hostname: "t3-sut1"
--- /dev/null
+---
+# file: host_vars/10.30.51.26.yaml
+
+hostname: "t3-sut2"
--- /dev/null
+---
+# file: host_vars/10.30.51.28.yaml
+
+hostname: "t4-virl1"
+virl_l2_start: "10.30.52.2"
+virl_l2_end: "10.30.52.253"
+virl_l2_gateway: "10.30.52.1"
+virl_l2_network: "10.30.52.0/24"
+virl_l2_ip: "10.30.52.254"
+virl_public_port: "eth0"
--- /dev/null
+---
+# file: host_vars/10.30.51.29.yaml
+
+hostname: "t4-virl2"
+virl_l2_start: "10.30.53.2"
+virl_l2_end: "10.30.53.253"
+virl_l2_gateway: "10.30.53.1"
+virl_l2_network: "10.30.53.0/24"
+virl_l2_ip: "10.30.53.254"
+virl_public_port: "eth4"
--- /dev/null
+---
+# file: host_vars/10.30.51.30.yaml
+
+hostname: "t4-virl3"
+virl_l2_start: "10.30.54.2"
+virl_l2_end: "10.30.54.253"
+virl_l2_gateway: "10.30.54.1"
+virl_l2_network: "10.30.54.0/24"
+virl_l2_ip: "10.30.54.254"
+virl_public_port: "eth0"
--- /dev/null
+---
+# file: host_vars/10.30.51.44.yaml
+
+hostname: "s1-t21-sut1"
--- /dev/null
+---
+# file: host_vars/10.30.51.45.yaml
+
+hostname: "s2-t21-tg1"
--- /dev/null
+---
+# file: host_vars/10.30.51.46.yaml
+
+hostname: "s9-t31-sut1"
--- /dev/null
+---
+# file: host_vars/10.30.51.47.yaml
+
+hostname: "s10-t31-sut2"
--- /dev/null
+---
+# file: host_vars/10.30.51.48.yaml
+
+hostname: "s11-t31-tg1"
--- /dev/null
+all:\r
+ children:\r
+# haswell:\r
+# children:\r
+# tg:\r
+# hosts:\r
+# 10.30.51.16: null #t1-tg1\r
+# 10.30.51.20: null #t2-tg1\r
+# 10.30.51.24: null #t3-tg1\r
+# sut:\r
+# hosts:\r
+# 10.30.51.17: null #t1-sut1\r
+# 10.30.51.18: null #t1-sut2\r
+# 10.30.51.21: null #t2-sut1\r
+# 10.30.51.22: null #t2-sut2\r
+# 10.30.51.25: null #t3-sut1\r
+# 10.30.51.26: null #t3-sut2\r
+# virl: # WARNING, DO NOT ENABLE VIRL UNLESS YOU KNOW WHAT YOU ARE DOING\r
+# hosts:\r
+# 10.30.51.28: null #t4-virl1\r
+# 10.30.51.29: null #t4-virl2\r
+# 10.30.51.30: null #t4-virl3\r
+ skylake:\r
+ children:\r
+ tg:\r
+ hosts:\r
+ 10.30.51.45: null #s2-t21-tg1\r
+ 10.30.51.48: null #s11-t31-tg1\r
+ sut:\r
+ hosts:\r
+ 10.30.51.44: null #s1-t21-sut1\r
+ 10.30.51.46: null #s9-t31-sut1\r
+ 10.30.51.47: null #s10-t31-sut2\r
+# arm:\r
+# children:\r
+# tg:\r
+# hosts:\r
+# sut:\r
+# hosts:\r
--- /dev/null
+# deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
+
+# deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
+# deb http://security.ubuntu.com/ubuntu bionic-security main restricted
+
+# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
+# newer versions of the distribution.
+deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
+
+## Major bug fix updates produced after the final release of the
+## distribution.
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team. Also, please note that software in universe WILL NOT receive any
+## review or updates from the Ubuntu security team.
+deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team, and may not be under a free licence. Please satisfy yourself as to
+## your rights to use the software. Also, please note that software in
+## multiverse WILL NOT receive any review or updates from the Ubuntu
+## security team.
+deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
+
+## N.B. software from this repository may not have been tested as
+## extensively as that contained in the main release, although it includes
+## newer versions of some applications which may provide useful features.
+## Also, please note that software in backports WILL NOT receive any review
+## or updates from the Ubuntu security team.
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
+deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
+
+deb http://security.ubuntu.com/ubuntu bionic-security main restricted
+deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
+deb http://security.ubuntu.com/ubuntu bionic-security universe
+deb-src http://security.ubuntu.com/ubuntu bionic-security universe
+deb http://security.ubuntu.com/ubuntu bionic-security multiverse
+deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
+
+## Uncomment the following two lines to add software from Canonical's
+## 'partner' repository.
+## This software is not part of Ubuntu, but is offered by Canonical and the
+## respective vendors as a service to Ubuntu users.
+# deb http://archive.canonical.com/ubuntu bionic partner
+# deb-src http://archive.canonical.com/ubuntu bionic partner
+
+## Uncomment the following two lines to add software from Ubuntu's
+## 'extras' repository.
+## This software is not part of Ubuntu, but is offered by third-party
+## developers who want to ship their latest software.
+# deb http://extras.ubuntu.com/ubuntu bionic main
+# deb-src http://extras.ubuntu.com/ubuntu bionic main
--- /dev/null
+---
+# file: roles/common/handlers/main.yaml
+
+- name: Update GRUB
+ command: update-grub
+ tags: update-grub
--- /dev/null
+---
+# file roles/common/handlers/reboot.yaml
+
+- name: Reboot host
+ command: shutdown -r now "Ansible updates triggered"
+ async: 0
+ poll: 0
+ ignore_errors: true
+ tags: reboot-host
+
+- name: Waiting for server to come back
+ local_action: wait_for host={{ inventory_hostname }}
+ state=started
+ tags: reboot-host
--- /dev/null
+---\r
+# file: roles/common/tasks/main.yaml\r
+\r
+- name: Ubuntu specific\r
+ import_tasks: ubuntu_x86_64.yaml\r
+ when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'\r
+\r
+- name: Set hostname\r
+ hostname:\r
+ name: '{{ hostname }}'\r
+ tags: set-hostname\r
+\r
+- name: Ensure hostname is in /etc/hosts\r
+ lineinfile:\r
+ path: '/etc/hosts'\r
+ regexp: '^{{ ansible_default_ipv4.address }}.+$'\r
+ line: '{{ ansible_default_ipv4.address }} {{ hostname }}.linuxfoundation.org'\r
+ tags: set-hostname\r
+\r
+- name: Set sudoers\r
+ lineinfile:\r
+ path: '/etc/sudoers'\r
+ state: 'present'\r
+ regexp: '^%admin ALL='\r
+ line: '%admin ALL=(ALL) ALL'\r
+ validate: '/usr/sbin/visudo -cf %s'\r
+ tags: set-sudoers\r
+\r
+- name: Set sudoers\r
+ lineinfile:\r
+ path: '/etc/sudoers'\r
+ state: 'present'\r
+ regexp: '^%sudo'\r
+ line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'\r
+ validate: '/usr/sbin/visudo -cf %s'\r
+ tags: set-sudoers\r
+\r
+- name: Copy grub file\r
+ template:\r
+ src: 'files/grub'\r
+ dest: '/etc/default/grub'\r
+ owner: 'root'\r
+ group: 'root'\r
+ mode: '644'\r
+ notify: ['Update GRUB']\r
+ tags: copy-grub\r
--- /dev/null
+---\r
+# file: roles/common/tasks/ubuntu_x86_64.yaml\r
+\r
+- name: Copy apt sources file\r
+ template:\r
+ src: 'files/apt-sources.list'\r
+ dest: '/etc/apt/sources.list'\r
+ tags: copy-apt-sources\r
+\r
+- name: Install python-apt\r
+ apt:\r
+ name: 'python-apt'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-python-apt\r
+\r
+- name: Install git\r
+ apt:\r
+ name: 'git'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-git\r
+\r
+- name: Install crudini\r
+ apt:\r
+ name: 'crudini'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-crudini\r
+\r
+- name: Install expect\r
+ apt:\r
+ name: 'expect'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-expect\r
+\r
+- name: Install socat\r
+ apt:\r
+ name: 'socat'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-socat\r
+\r
+- name: Install qemu\r
+ apt:\r
+ name: 'qemu-system-x86'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-qemu\r
--- /dev/null
+---\r
+# file: roles/sut/tasks/main.yaml\r
+\r
+- name: Ubuntu specific\r
+ import_tasks: ubuntu_x86_64.yaml\r
+ when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'\r
+\r
+- name: Copy 80-vpp.conf\r
+ file:\r
+ src: '/dev/null'\r
+ dest: '/etc/sysctl.d/80-vpp.conf'\r
+ state: 'link'\r
+ become: yes\r
+ tags: copy-80-vpp\r
--- /dev/null
+---\r
+# file: roles/sut/tasks/ubuntu_x86_64.yaml\r
+\r
+- name: Install DKMS\r
+ apt:\r
+ name: 'dkms'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-dkms\r
+\r
+- name: Install pkg-config\r
+ apt:\r
+ name: 'pkg-config'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-pkg-config\r
+\r
+- name: Install libglib2.0-dev\r
+ apt:\r
+ name: 'libglib2.0-dev'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-libglib2.0-dev\r
+\r
+- name: Install autoconf\r
+ apt:\r
+ name: 'autoconf'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-autoconf\r
+\r
+- name: Install libtool\r
+ apt:\r
+ name: 'libtool'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-libtool\r
+\r
+- name: Install screen\r
+ apt:\r
+ name: 'screen'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-screen\r
+\r
+- name: Install libmbedcrypto1\r
+ apt:\r
+ name: 'libmbedcrypto1'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-libmbedcrypto1\r
+\r
+- name: Install libmbedtls10\r
+ apt:\r
+ name: 'libmbedtls10'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-libmbedtls10\r
+\r
+- name: Install libmbedx509-0\r
+ apt:\r
+ name: 'libmbedx509-0'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-libmbedx509-0\r
+\r
+- name: Install lxc\r
+ apt:\r
+ name: 'lxc'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-lxc\r
+\r
+- name: Install java\r
+ apt:\r
+ name: 'openjdk-8-jdk'\r
+ state: 'present'\r
+ update_cache: True\r
+ become: yes\r
+ tags: install-java\r
--- /dev/null
+---\r
+# file: roles/tg/tasks/main.yaml\r
+\r
+- name: Ubuntu specific\r
+ import_tasks: ubuntu_x86_64.yaml\r
+ when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'\r
--- /dev/null
+---\r
+# file: roles/tg/tasks/ubuntu_x86_64.yaml\r
+\r
+- name: Install Unzip\r
+ apt:\r
+ name: 'unzip'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-unzip\r
--- /dev/null
+---
+docker_edition: "ce"
+docker_channel: "edge"
+
+docker_version: "18.05.0"
+docker_install_docker_compose: True
+docker_compose_version: "1.21.0"
+
+docker_users: ['testuser']
+
+docker_daemon_options: []
+# Can be used to set environment variables for the Docker daemon, such as:
+# docker_daemon_environment:
+# - "HTTP_PROXY=http://proxy.example.com:3128/"
+# - "HTTPS_PROXY=http://proxy.example.com:3128/"
+# - "NO_PROXY=localhost,127.0.0.1"
+docker_daemon_environment: []
+
+docker_apt_key: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
+docker_repository: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_channel }}"
+docker_apt_package_name: "{{ docker_version }}~{{ docker_edition }}~3-0~{{ ansible_distribution | lower }}"
+
+apt_cache_time: 86400
+
+kubernetes_channel: "main"
+kubernetes_version: "1.10.3"
+
+kubernetes_apt_key: "54A647F9048D5688D7DA2ABE6A030B21BA07F4FB"
+kubernetes_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_channel }}"
+kubernetes_apt_package_name: "{{ kubernetes_version }}-00"
--- /dev/null
+robotframework==2.9.2
+paramiko==1.16.0
+scp==0.10.2
+ipaddress==1.0.16
+interruptingcow==0.6
+PyYAML==3.11
+pykwalify==1.5.0
+scapy==2.3.1
+enum34==1.1.2
+requests==2.9.1
+ecdsa==0.13
+pycrypto==2.6.1
+pypcap==1.1.5
--- /dev/null
+---
+# file roles/tg_sut/handlers/main.yaml
+
+- name: Restart Docker
+ service:
+ name: 'docker'
+ state: 'restarted'
+ tags: restart-docker
--- /dev/null
+---\r
+# file: roles/tg_sut/tasks/main.yaml\r
+\r
+- name: Ubuntu specific\r
+ import_tasks: ubuntu_x86_64.yaml\r
+ when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'\r
+\r
+- name: Copy interfaces file\r
+ template:\r
+ src: 'files/interfaces_physical'\r
+ dest: '/etc/network/interfaces'\r
+ owner: 'root'\r
+ group: 'root'\r
+ mode: '0644'\r
+ tags: copy-interface-file\r
+\r
+- name: Copy sysctl file\r
+ template:\r
+ src: 'files/90-csit'\r
+ dest: '/etc/sysctl.d/90-csit.conf'\r
+ owner: 'root'\r
+ group: 'root'\r
+ mode: '0644'\r
+ tags: copy-90-csit\r
+\r
+- name: Copy IRQ load balancing file\r
+ copy:\r
+ src: 'files/irqbalance'\r
+ dest: '/etc/default/irqbalance'\r
+ owner: 'root'\r
+ group: 'root'\r
+ mode: '0644'\r
+ tags: copy-irq\r
+\r
+- name: Copy cpufrequtils file\r
+ copy:\r
+ src: 'files/cpufrequtils'\r
+ dest: '/etc/default/cpufrequtils'\r
+ owner: 'root'\r
+ group: 'root'\r
+ mode: '0644'\r
+ tags: copy-cpufrequtils\r
+\r
+- name: Copy Python requirements file\r
+ copy:\r
+ src: 'files/requirements.txt'\r
+ dest: '/tmp/requirements.txt'\r
+ tags: copy-pip\r
+\r
+- name: Set isolcpus and pstate parameter\r
+ lineinfile:\r
+ path: '/etc/default/grub'\r
+ state: 'present'\r
+ regexp: '^GRUB_CMDLINE_LINUX='\r
+ line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} intel_pstate=disable"'\r
+ notify: ['Update GRUB']\r
+ tags: set-grub\r
+\r
+- name: Set ondemand service to disable\r
+ service:\r
+ name: 'ondemand'\r
+ enabled: 'no'\r
+ tags: set-ondemand\r
+\r
+- name: Install PIP requirements\r
+ pip:\r
+ requirements: '/tmp/requirements.txt'\r
+ tags: install-pip\r
--- /dev/null
+---\r
+# file: roles/tg_sut/tasks/ubuntu_x86_64.yaml\r
+\r
+- name: Install python-dev\r
+ apt:\r
+ name: 'python-dev'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-python-dev\r
+\r
+- name: Install python-virtualenv\r
+ apt:\r
+ name: 'python-virtualenv'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-python-virtualenv\r
+\r
+- name: Install python pip\r
+ apt:\r
+ name: 'python-pip'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-python-pip\r
+\r
+- name: Install libpcap-dev\r
+ apt:\r
+ name: 'libpcap-dev'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-libpcap-dev\r
+\r
+- name: Install cpufrequtils\r
+ apt:\r
+ name: 'cpufrequtils'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-cpufrequtils\r
+\r
+- name: Install cgroup-support\r
+ apt:\r
+ name: 'cgroup-bin'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-cgroup-support\r
+\r
+- name: Install zlib1g-dev\r
+ apt:\r
+ name: 'zlib1g-dev'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-zlib1g-dev\r
+\r
+- name: Install libnuma-dev\r
+ apt:\r
+ name: 'libnuma-dev'\r
+ state: 'present'\r
+ update_cache: True\r
+ tags: install-libnuma-dev\r
+\r
+- name: Install Docker and role dependencies\r
+ apt:\r
+ name: "{{ item }}"\r
+ state: "present"\r
+ install_recommends: False\r
+ with_items:\r
+ - "apt-transport-https"\r
+ - "ca-certificates"\r
+ - "software-properties-common"\r
+ - "cron"\r
+ tags: install-docker\r
+\r
+- name: Install upstream APT GPG key\r
+ apt_key:\r
+ id: "{{ docker_apt_key }}"\r
+ keyserver: "{{ ansible_local.core.keyserver\r
+ if (ansible_local|d() and ansible_local.core|d() and\r
+ ansible_local.core.keyserver)\r
+ else 'hkp://pool.sks-keyservers.net' }}"\r
+ state: "present"\r
+ tags: install-docker\r
+\r
+- name: Install upstream APT repository\r
+ apt_repository:\r
+ repo: "{{ docker_repository }}"\r
+ state: "present"\r
+ update_cache: True\r
+ tags: install-docker\r
+\r
+- name: Install Docker\r
+ apt:\r
+ name: "docker-{{ docker_edition }}={{ docker_apt_package_name }}"\r
+ state: "present"\r
+ update_cache: True\r
+ install_recommends: False\r
+ cache_valid_time: "{{ apt_cache_time }}"\r
+ tags: install-docker\r
+\r
+- name: Remove Upstart config file\r
+ file:\r
+ path: "/etc/default/docker"\r
+ state: "absent"\r
+ tags: docker\r
+\r
+- name: Ensure systemd directory exists\r
+ file:\r
+ path: "/etc/systemd/system"\r
+ state: "directory"\r
+ owner: "root"\r
+ group: "root"\r
+ mode: "0755"\r
+ tags: ensure-docker\r
+\r
+- name: Copy systemd unit file\r
+ template:\r
+ src: "templates/docker.service.j2"\r
+ dest: "/etc/systemd/system/docker.service"\r
+ owner: "root"\r
+ group: "root"\r
+ mode: "0644"\r
+ register: docker_register_systemd_service\r
+ tags: copy-docker\r
+\r
+- name: Reload systemd daemon\r
+ command: "systemctl daemon-reload"\r
+ notify: ["Restart Docker"]\r
+ when: (docker_register_systemd_service and\r
+ docker_register_systemd_service | changed)\r
+ tags: restart-docker\r
+\r
+- name: Set specific users to "docker" group\r
+ user:\r
+ name: "{{ item }}"\r
+ groups: "docker"\r
+ append: True\r
+ with_items: "{{ docker_users }}"\r
+ when: docker_users\r
+ tags: set-docker\r
+\r
+- name: Install upstream APT GPG key\r
+ apt_key:\r
+ id: "{{ kubernetes_apt_key }}"\r
+ keyserver: "{{ ansible_local.core.keyserver\r
+ if (ansible_local|d() and ansible_local.core|d() and\r
+ ansible_local.core.keyserver)\r
+ else 'hkp://pool.sks-keyservers.net' }}"\r
+ state: "present"\r
+ tags: install-kubernetes\r
+\r
+- name: Install upstream APT repository\r
+ apt_repository:\r
+ repo: "{{ kubernetes_repository }}"\r
+ state: "present"\r
+ update_cache: True\r
+ tags: install-kubernetes\r
+\r
+- name: Install kubeadm\r
+ apt:\r
+ name: "kubeadm={{ kubernetes_apt_package_name }}"\r
+ state: "present"\r
+ update_cache: True\r
+ install_recommends: False\r
+ cache_valid_time: "{{ apt_cache_time }}"\r
+ tags: install-kubernetes\r
+\r
+- name: Install kubectl\r
+ apt:\r
+ name: "kubectl={{ kubernetes_apt_package_name }}"\r
+ state: "present"\r
+ update_cache: True\r
+ install_recommends: False\r
+ cache_valid_time: "{{ apt_cache_time }}"\r
+ tags: install-kubernetes\r
+\r
+- name: Install kubelet\r
+ apt:\r
+ name: "kubelet={{ kubernetes_apt_package_name }}"\r
+ state: "present"\r
+ update_cache: True\r
+ install_recommends: False\r
+ cache_valid_time: "{{ apt_cache_time }}"\r
+ tags: install-kubernetes\r
+\r
--- /dev/null
+# {{ ansible_managed }}
+
+[Unit]
+Description=Docker Application Container Engine
+Documentation=https://docs.docker.com
+After=network-online.target docker.socket
+Requires=docker.socket
+
+[Service]
+Type=notify
+# the default is not to use systemd for cgroups because the delegate issues still
+# exists and systemd currently does not support the cgroup feature set required
+# for containers run by docker
+{% if docker_daemon_environment %}
+Environment="{{ docker_daemon_environment | join('" "') }}"
+{% endif %}
+ExecStart=/usr/bin/dockerd {{ docker_daemon_options | join(" ") }}
+ExecReload=/bin/kill -s HUP $MAINPID
+# Having non-zero Limit*s causes performance problems due to accounting overhead
+# in the kernel. We recommend using cgroups to do container-local accounting.
+LimitNOFILE=infinity
+LimitNPROC=infinity
+LimitCORE=infinity
+# Uncomment TasksMax if your systemd version supports it.
+# Only systemd 226 and above support this version.
+TasksMax=infinity
+TimeoutStartSec=0
+# set delegate yes so that systemd does not reset the cgroups of docker containers
+Delegate=yes
+# kill only the docker process, not all processes in the cgroup
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+robotframework==2.9.2
+paramiko==1.16.0
+scp==0.10.2
+ipaddress==1.0.16
+interruptingcow==0.6
+PyYAML==3.11
+pykwalify==1.5.0
+scapy==2.3.1
+enum34==1.1.2
+requests==2.9.1
+ecdsa==0.13
+pycrypto==2.6.1
+pypcap==1.1.5
---
-- hosts: virl
- remote_user: virl
- tasks:
- name: install virl-bootstrap
git:
repo: 'https://github.com/VIRL-Open/virl-bootstrap.git'
dest: /home/virl/virl-bootstrap
version: xenial
+ become_user: virl
- name: copy vsetting file to /etc
- sudo: yes
shell: /usr/bin/install -m 666 /home/virl/virl-bootstrap/vsettings.ini /etc/virl.ini
+ become: yes
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT hostname {{ hostname }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT domain_name linuxfoundation.org
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT using_dhcp_on_the_public_port False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT public_port dummy3
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT Static_IP 10.30.49.28
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT public_network 10.30.49.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT public_netmask {{ ansible_default_ipv4["netmask"] }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT public_gateway 10.30.49.1
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT proxy False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT ntp_server pool.ntp.org
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT first_nameserver 199.204.44.24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT second_nameserver 199.204.47.54
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT salt_master vsm-md.virl.info
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT salt_id {{ hostname }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT salt_domain linuxfoundation.org
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT salt_masterless false
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_port {{ virl_public_port }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_network {{ virl_l2_network }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_mask 255.255.255.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_network_gateway {{ virl_l2_gateway }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_start_address {{ virl_l2_start }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_end_address {{ virl_l2_end }}
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_address {{ ansible_default_ipv4["address"] }}/24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT first_flat_nameserver 199.204.44.24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT second_flat_nameserver 199.204.47.54
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_port2_enabled True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_port2 dummy0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_network2 172.16.2.0/24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_mask2 255.255.255.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_network_gateway2 172.16.2.1
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_start_address2 172.16.2.50
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_end_address2 172.16.2.253
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l2_address2 172.16.2.254/24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT first_flat2_nameserver 199.204.44.24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT second_flat2_nameserver 199.204.47.54
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_port dummy1
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_network 172.16.3.0/24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_mask 255.255.255.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_network_gateway 172.16.3.1
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_floating_start_address 172.16.3.50
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_floating_end_address 172.16.3.253
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT l3_address 172.16.3.254/24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT first_snat_nameserver 199.204.44.24
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT second_snat_nameserver 199.204.47.54
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT ramdisk True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT ank 19401
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT ank_live 19402
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT virl_webservices 19399
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT virl_user_management 19400
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT virl_apache_port 80
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT virl_webmux 19403
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT Start_of_serial_port_range 17000
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT End_of_serial_port_range 18000
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT serial_port 19406
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vnc_port 19407
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT location_region US
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vnc False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT guest_account True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT user_list tb4-virl:Cisco1234
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT uwmadmin_password Cisco1234
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT password password
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT mysql_password password
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT keystone_service_token fkgjhsdflkjh
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT enable_cinder True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT cinder_file True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT cinder_size 20000
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT cinder_location /var/lib/cinder/cinder-volumes.lvm
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT dummy_int True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT this_node_is_the_controller True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_controller_hostname controller
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_controller_IP 172.16.10.250
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_port dummy2
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_IP 172.16.10.250
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_network 172.16.10.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_netmask 255.255.255.0
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT internalnet_gateway 172.16.10.1
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT iosv True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT csr1000v True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT iosxrv432 False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT iosxrv52 False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT iosxrv True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT nxosv True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vpagent True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT iosvl2 True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT asav True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT lxc_server True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT lxc_iperf True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT lxc_routem True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT lxc_ostinato True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT server True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vmm_mac True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vmm_win32 True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vmm_win64 True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT vmm_linux True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT virl_clients True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT ram_overcommit 2
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT web_editor True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT mitaka True
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT kilo False
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT libvirt_cpu_mode host-passthrough
+ become_user: virl
- command: crudini --inplace --set /etc/virl.ini DEFAULT neutron_bridge_flooding True
+ become_user: virl
- name: copy vinstall bootstrap wrapper script
template: src=files/virl/virl-bootstrap-wrapper dest=/home/virl/virl-bootstrap/virl-bootstrap-wrapper owner=virl group=virl mode=775
+ become_user: virl
---
-- hosts: virl
- remote_user: testuser
- sudo: yes
- tasks:
- name: Add jenkins-in user
user: name=jenkins-in shell=/bin/bash comment="Jenkins user"
- name: Add jenkins-in user to sudoers
lineinfile: dest=/etc/ssh/sshd_config state=present regexp='PermitUserEnvironment.*' line='PermitUserEnvironment yes'
- name: Restart SSH daemon
service: name=ssh state=restarted
-- hosts: virl
- remote_user: jenkins-in
- tasks:
- name: clone csit git repository
git: repo=https://gerrit.fd.io/r/csit
dest=/home/jenkins-in/git/csit
+ become: jenkins-in
- name: Link testcase-infra directory
command: ln -sf /home/jenkins-in/git/csit/resources/tools/virl /home/jenkins-in/testcase-infra
args:
creates: /home/jenkins-in/testcase-infra
+ become: jenkins-in
- name: Create bin directory
file: path=/home/jenkins-in/bin state=directory mode=0755
+ become: jenkins-in
- name: Link start-testcase executable
command: ln -sf /home/jenkins-in/testcase-infra/bin/start-testcase /home/jenkins-in/bin/start-testcase
args:
creates: /home/jenkins-in/bin/start-testcase
+ become: jenkins-in
- name: Link stop-testcase executable
command: ln -sf /home/jenkins-in/testcase-infra/bin/stop-testcase /home/jenkins-in/bin/stop-testcase
args:
creates: /home/jenkins-in/bin/stop-testcase
+ become: jenkins-in
- name: Link kill-idle-testcases executable
command: ln -sf /home/jenkins-in/testcase-infra/bin/kill-idle-testcases /home/jenkins-in/bin/kill-idle-testcases
args:
creates: /home/jenkins-in/bin/kill-idle-testcases
+ become: jenkins-in
- name: Copy SSH private key
copy: src=files/virl/id_rsa_virl dest=/home/jenkins-in/.ssh/id_rsa_virl mode=600
+ become: jenkins-in
- name: Copy SSH public key
copy: src=files/virl/id_rsa_virl.pub dest=/home/jenkins-in/.ssh/id_rsa_virl.pub mode=644
+ become: jenkins-in
- name: Copy SSH environment
copy: src=files/virl/ssh_environment dest=/home/jenkins-in/.ssh/environment mode=644
+ become: jenkins-in
- name: Add ~/bin to path
lineinfile: dest=/home/jenkins-in/.bashrc state=present line='PATH=${HOME}/bin:$PATH'
+ become: jenkins-in
- name: Update own IP address in start script
shell: sed -i /home/jenkins-in/testcase-infra/bin/start-testcase -e 's/10.30.51.28/{{ ansible_default_ipv4["address"] }}/'
+ become: jenkins-in
- name: Add authorized key
lineinfile: dest=/home/jenkins-in/.ssh/authorized_keys line='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD4gderzsZyoxHULjuvPHoJuKnkaGrykqtuoqs/k1/jUdxitPoY5eX2cVYqww7MiUif7zLsiXbt5mHtyxAYCluDxAuIcy1xgSZY3MpmmSqDie4A/FdVfCUqCcpf3TZKsRP0an1MNrKIe0JFZV+uU889IDRQRdboGMs3+4cn5b9fOutpv71qwFVrTm9PZbqfQonrrN8Jp4Mz3XaZDpK22xwDAWhYOZ0eV6CJWquUgbYAHE6/HHMvd0zeJKaWZCXO/1tOGOj6cjgoViHqbnCtmYCjmv/ir0IglzbUdWdOqQY5YkhnPonveV48lVKrmBipqgbDezAUQD8wOQ7HttpYpKgt jenkins-in@tb4-virl'
+ become: jenkins-in
# All of the below will fail if VIRL user/project already exist
-- hosts: virl
- remote_user: virl
- tasks:
- name: Create VIRL project
shell: virl_uwm_client project-edit --name tb4-virl --enabled True -i 400 -r 1024000 -c 500
ignore_errors: true
+ become: virl
# - name: Delete VIRL project user
# shell: virl_uwm_client user-delete --name tb4-virl
# ignore_errors: true
- name: Create VPP flavor
shell: virl_uwm_client flavor-create --name vPP --ram 4096 --vcpus 2 --disk 0
ignore_errors: true
+ become: virl
---
-- hosts: virl
- remote_user: virl
- tasks:
- name: Create server image directory
file: path=/home/virl/virl-server-image state=directory mode=0755
+ become: virl
- name: Copy UBUNTU server image
copy: src=/home/virl/virl-server-image/packer-csit-ubuntu-16.04.1_2017-10-21_2.0-qemu dest=/home/virl/virl-server-image/packer-csit-ubuntu-16.04.1_2017-10-21_2.0-qemu owner=virl group=virl mode=644
+ become: virl
- name: Copy CENTOS server image
copy: src=/home/virl/virl-server-image/packer-csit-centos-7.3-1611_2017-02-23_1.4-qemu dest=/home/virl/virl-server-image/packer-csit-centos-7.3-1611_2017-02-23_1.4-qemu owner=virl group=virl mode=644
+ become: virl
- name: Import UBUNTU server image into glance
shell: virl_uwm_client image-create --subtype server --version csit-ubuntu-16.04.1_2017-10-21_2.0 --image-on-server /home/virl/virl-server-image/packer-csit-ubuntu-16.04.1_2017-10-21_2.0-qemu
+ become: virl
- name: Import CENTOS server image into glance
shell: virl_uwm_client image-create --subtype server --version csit-centos-7.3-1611_2017-02-23_1.4 --image-on-server /home/virl/virl-server-image/packer-csit-centos-7.3-1611_2017-02-23_1.4-qemu
-- hosts: virl
- remote_user: testuser
- sudo: yes
- tasks:
+ become: virl
- name: Create common directory
file: path=/nfs/common state=directory mode=0755
- name: Create Nested VM directory
file:
src: /nfs/common/nested-vm-current.img.disabled
dest: /nfs/common/nested-vm/csit-nested-1.6.img
- state: link
\ No newline at end of file
+ state: link
--- /dev/null
+---
+- name: Interfaces file
+ template:
+ src: "files/interfaces_virl"
+ dest: "/etc/network/interfaces owner=root group=root mode=644"
+ tags: interfaces
+
+- name: Add VIRL user
+ user:
+ name: virl
+ shell: "/bin/bash"
+ comment: "VIRL user"
+ password: "$6$mJPlK5FKLar6$xxXPP0LRhC7T1yhHtym18Z3nKZweTtfTxzi1WpvVHJ0U/Em1UWcHqfMhRApFp0rsY9jHRuL6FfeFbKPN..uDK."
+ tags: users
+
+- name: Add VIRL user to sudoers
+ copy:
+ src: "files/sudoers_virl"
+ dest: "/etc/sudoers.d/virl owner=root group=root mode=660"
+ tags: sudoers
+
+- name: Add post up for additional address
+ copy:
+ src: "files/ifup"
+ dest: "/etc/network/if-up.d/virl owner=root group=root mode=755"
+ tags: interfaces
+
+- name: Set VIRL user authorized key
+ authorized_key:
+ user: virl
+ key: "{{ lookup('file', '/home/testuser/.ssh/id_rsa.pub') }}"
+ tags: users
+
+- name: Install bridge-utils
+ apt:
+ name: "bridge-utils"
+ state: "present"
+ tags: apt-install-bridge-utils
+
+- name: Old interface naming
+ command: "ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules"
+ tags: interfaces
+
+- name: Update init for old interface naming
+ command: "update-initramfs -u"
+ tags: interfaces
+
+- name: QEMU log garbage collector
+ cron:
+ minute: "0"
+ hour: "0"
+ name: "QEMU log garbage collector"
+ job: "find /var/log/libvirt/qemu -type f -mtime +14 -name 'instance*.log' -delete"
+ tags: cron
+
+- name: VPP deb package garbage collector
+ cron:
+ minute: "0"
+ hour: "0"
+ name: "VPP deb package garbage collector"
+ job: "find /tmp -type f -atime +14 -name '*.deb' -delete"
+ tags: cron
+
+- name: VPP rpm package garbage collector
+ cron:
+ minute: "0"
+ hour: "0"
+ name: "VPP rpm package garbage collector"
+ job: "find /tmp -type f -atime +14 -name '*.rpm' -delete"
+ tags: cron
+
+- name: NFS scratch dir garbage collector
+ cron:
+ minute: "0"
+ hour: "0"
+ name: "NFS scratch dir garbage collector"
+ job: "find /nfs/scratch/ -type d -mtime +1 -name 'session-*' -exec rm -r '{}' \\;"
+ tags: cron
--- /dev/null
+---\r
+# file: site.yaml\r
+\r
+- import_playbook: tg.yaml\r
+ tags: tg\r
+\r
+- import_playbook: sut.yaml\r
+ tags: sut\r
+\r
+- import_playbook: virl.yaml\r
+ tags: virl\r
--- /dev/null
+---\r
+# file: sut.yaml\r
+\r
+- hosts: sut\r
+ remote_user: testuser\r
+ become: yes\r
+ become_user: root\r
+ roles:\r
+ - common\r
+ - sut\r
+ - tg_sut\r
--- /dev/null
+---\r
+# file: tg.yaml\r
+\r
+- hosts: tg\r
+ remote_user: testuser\r
+ become: yes\r
+ become_user: root\r
+ roles:\r
+ - common\r
+ - tg\r
+ - tg_sut\r
--- /dev/null
+---\r
+# file: virl.yaml\r
+\r
+- hosts: virl\r
+ remote_user: testuser\r
+ become: yes\r
+ become_user: root\r
+ roles:\r
+ - common\r
+ - virl\r
+++ /dev/null
-#[tg]
-#10.30.51.16 hostname=t1-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.20 hostname=t2-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.24 hostname=t3-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-
-#[sut]
-#10.30.51.17 hostname=t1-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.18 hostname=t1-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.21 hostname=t2-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.22 hostname=t2-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.25 hostname=t3-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-#10.30.51.26 hostname=t3-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7
-
-#By default, let's not touch the VIRL host. Any (unintended) configuration change on VIRL host
-#is a recipe for disaster.
-#[virl]
-#10.30.51.28 hostname=t4-virl1 virl_l2_start=10.30.52.2 virl_l2_end=10.30.52.253 ansible_python_interpreter=/usr/bin/python2.7 virl_l2_gateway=10.30.52.1 virl_l2_network=10.30.52.0/24 virl_l2_ip=10.30.52.254 virl_public_port=eth0
-#10.30.51.29 hostname=t4-virl2 virl_l2_start=10.30.53.2 virl_l2_end=10.30.53.253 ansible_python_interpreter=/usr/bin/python2.7 virl_l2_gateway=10.30.53.1 virl_l2_network=10.30.53.0/24 virl_l2_ip=10.30.53.254 virl_public_port=eth4
-#10.30.51.30 hostname=t4-virl3 virl_l2_start=10.30.54.2 virl_l2_end=10.30.54.253 ansible_python_interpreter=/usr/bin/python2.7 virl_l2_gateway=10.30.54.1 virl_l2_network=10.30.54.0/24 virl_l2_ip=10.30.54.254 virl_public_port=eth0
+++ /dev/null
----
-- hosts: all
- remote_user: testuser
- sudo: yes
- tasks:
- - name: copy sudoers file
- copy: src=files/sudoers dest=/etc/sudoers.d/testuser owner=root group=root mode=660
- - name: copy hosts file
- template: src=files/hosts dest=/etc/hosts owner=root group=root mode=644
- - name: copy hostname file
- template: src=files/hostname dest=/etc/hostname owner=root group=root mode=644
- - name: copy grub file
- template: src=files/grub dest=/etc/default/grub owner=root group=root mode=644
- - name: update grub
- command: update-grub
- - name: copy apt sources file
- template: src=files/apt-sources.list dest=/etc/apt/sources.list
- - name: install python-apt
- raw: apt-get update && apt-get install python-apt -y -q
- - name: update repositories
- apt: update_cache=yes
- - name: install git
- apt: name=git state=present
- - name: install crudini
- apt: name=crudini state=present
- - name: install expect
- apt: name=expect state=present
- - name: install socat
- apt: name=socat state=present
- - name: install qemu
- apt: name=qemu-system-x86 state=present
- - name: Install packages to allow apt to use a repository over HTTPS
- apt: name=apt-transport-https state=present
-- hosts: virl
- remote_user: testuser
- sudo: yes
- tasks:
- - name: interfaces file
- template: src=files/interfaces_virl dest=/etc/network/interfaces owner=root group=root mode=644
- - name: Add VIRL user
- user: name=virl shell=/bin/bash comment="VIRL user" password="$6$mJPlK5FKLar6$xxXPP0LRhC7T1yhHtym18Z3nKZweTtfTxzi1WpvVHJ0U/Em1UWcHqfMhRApFp0rsY9jHRuL6FfeFbKPN..uDK."
- - name: Add VIRL user to sudoers
- copy: src=files/sudoers_virl dest=/etc/sudoers.d/virl owner=root group=root mode=660
- - name: Add post up for additional address
- copy: src=files/ifup dest=/etc/network/if-up.d/virl owner=root group=root mode=755
- - name: Set VIRL user authorized key
- authorized_key: user=virl key="{{ lookup('file', '/home/testuser/.ssh/id_rsa.pub') }}"
- - name: install bridge-utils
- apt: name=bridge-utils state=present
- - name: Old interface naming
- command: ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
- - name: update init for old interface naming
- command: update-initramfs -u
- - name: QEMU log garbage collector
- cron: minute="0" hour="0"
- name="QEMU log garbage collector"
- job="find /var/log/libvirt/qemu -type f -mtime +14 -name 'instance*.log' -delete"
- - name: VPP deb package garbage collector
- cron: minute="0" hour="0"
- name="VPP deb package garbage collector"
- job="find /tmp -type f -atime +14 -name '*.deb' -delete"
- - name: VPP rpm package garbage collector
- cron: minute="0" hour="0"
- name="VPP rpm package garbage collector"
- job="find /tmp -type f -atime +14 -name '*.rpm' -delete"
- - name: NFS scratch dir garbage collector
- cron: minute="0" hour="0"
- name="NFS scratch dir garbage collector"
- job="find /nfs/scratch/ -type d -mtime +1 -name 'session-*' -exec rm -r '{}' \\;"
-- hosts: tg:sut
- remote_user: testuser
- sudo: yes
- tasks:
- - name: interfaces file
- template: src=files/interfaces_physical dest=/etc/network/interfaces owner=root group=root mode=644
- - name: copy sysctl file
- template: src=files/90-csit dest=/etc/sysctl.d/90-csit.conf owner=root group=root mode=644
- - name: isolcpus and pstate parameter
- lineinfile: dest=/etc/default/grub regexp=^GRUB_CMDLINE_LINUX= line=GRUB_CMDLINE_LINUX="\"isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} intel_pstate=disable\""
- - name: update grub
- command: update-grub
- - name: Install python-dev
- apt: name=python-dev state=present
- - name: Install python-virtualenv
- apt: name=python-virtualenv state=present
- - name: Install python pip
- apt: name=python-pip state=present
- - name: Install libpcap-dev
- apt: name=libpcap-dev state=present
- - name: Install cpufrequtils
- apt: name=cpufrequtils state=present
- - name: Set cpufrequtils defaults
- copy: src=files/cpufrequtils dest=/etc/default/cpufrequtils owner=root group=root mode=0644
- - name: Disable IRQ load balancing
- copy: src=files/irqbalance dest=/etc/default/irqbalance owner=root group=root mode=0644
- - name: Disable ondemand
- service: name=ondemand enabled=no
- - name: Install cgroup-support
- apt: name=cgroup-bin state=present
- - name: Install zlib1g-dev
- apt: name=zlib1g-dev state=present
- - name: Copy Python requirements file
- copy: src=files/requirements.txt dest=/tmp/requirements.txt
- - name: Install PIP requirements
- pip: requirements=/tmp/requirements.txt
- - name: Install libnuma-dev
- apt: name=libnuma-dev state=present
- - name: IRQ pinning
- lineinfile:
- dest: /etc/rc.local
- insertbefore: '^exit 0'
- line: 'for l in `ls /proc/irq`; do echo 1 | sudo tee /proc/irq/$l/smp_affinity; done'
- - name: RCU pinning
- lineinfile:
- dest: /etc/rc.local
- insertbefore: '^exit 0'
- line: 'for i in `pgrep rcu[^c]` ; do sudo taskset -pc 0 $i ; done'
- - name: CPU writeback mask
- lineinfile:
- dest: /etc/rc.local
- insertbefore: '^exit 0'
- line: 'echo 1 | sudo tee /sys/bus/workqueue/devices/writeback/cpumask'
-- hosts: tg
- remote_user: testuser
- sudo: yes
- tasks:
- - name: Install unzip
- apt: name=unzip state=present
-- hosts: sut
- remote_user: testuser
- sudo: yes
- tasks:
- - name: Install dkms
- apt: name=dkms state=present
- - name: Install pkg-config
- apt: name=pkg-config state=present
- - name: Install libglib2.0-dev
- apt: name=libglib2.0-dev state=present
- - name: Install autoconf
- apt: name=autoconf state=present
- - name: Install libtool
- apt: name=libtool state=present
- - name: Install screen
- apt: name=screen state=present
- - name: Install libmbedcrypto0
- apt: name=libmbedcrypto0 state=present
- - name: Install libmbedtls10
- apt: name=libmbedtls10 state=present
- - name: Install libmbedx509-0
- apt: name=libmbedx509-0 state=present
- - name: Install lxc
- apt: name=lxc state=present
- - name: Disable 80-vpp.conf
- file:
- src: /dev/null
- dest: /etc/sysctl.d/80-vpp.conf
- state: link
- - name: Install java
- apt: name=openjdk-8-jdk state=present
- - name: Add Docker's official GPG key
- apt_key:
- url: "https://download.docker.com/linux/ubuntu/gpg"
- state: present
- - name: Add Docker's stable repository
- apt_repository:
- repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
- state: present
- - name: Install Docker CE
- apt: name=docker-ce state=present
- - name: Add Kubernetes's official GPG key
- apt_key:
- url: "https://packages.cloud.google.com/apt/doc/apt-key.gpg"
- state: present
- - name: Add Kubernetes's stable repository
- apt_repository:
- repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
- state: present
- - name: Install Kubernetes kubelet
- apt: name=kubelet state=present
- - name: Install Kubernetes kubeadm
- apt: name=kubeadm state=present
\ No newline at end of file
+++ /dev/null
-# deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
-
-# deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
-# deb http://security.ubuntu.com/ubuntu xenial-security main restricted
-
-# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
-# newer versions of the distribution.
-deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
-
-## Major bug fix updates produced after the final release of the
-## distribution.
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
-
-## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
-## team. Also, please note that software in universe WILL NOT receive any
-## review or updates from the Ubuntu security team.
-deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
-
-## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
-## team, and may not be under a free licence. Please satisfy yourself as to
-## your rights to use the software. Also, please note that software in
-## multiverse WILL NOT receive any review or updates from the Ubuntu
-## security team.
-deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
-
-## N.B. software from this repository may not have been tested as
-## extensively as that contained in the main release, although it includes
-## newer versions of some applications which may provide useful features.
-## Also, please note that software in backports WILL NOT receive any review
-## or updates from the Ubuntu security team.
-deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
-deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
-
-deb http://security.ubuntu.com/ubuntu xenial-security main restricted
-deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
-deb http://security.ubuntu.com/ubuntu xenial-security universe
-deb-src http://security.ubuntu.com/ubuntu xenial-security universe
-deb http://security.ubuntu.com/ubuntu xenial-security multiverse
-deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
-
-## Uncomment the following two lines to add software from Canonical's
-## 'partner' repository.
-## This software is not part of Ubuntu, but is offered by Canonical and the
-## respective vendors as a service to Ubuntu users.
-# deb http://archive.canonical.com/ubuntu xenial partner
-# deb-src http://archive.canonical.com/ubuntu xenial partner
-
-## Uncomment the following two lines to add software from Ubuntu's
-## 'extras' repository.
-## This software is not part of Ubuntu, but is offered by third-party
-## developers who want to ship their latest software.
-# deb http://extras.ubuntu.com/ubuntu xenial main
-# deb-src http://extras.ubuntu.com/ubuntu xenial main
+++ /dev/null
-{{ hostname }}
+++ /dev/null
-127.0.0.1 localhost
-{{ ansible_default_ipv4["address"] }} {{ hostname }}.linuxfoundation.org {{ hostname }}
-
-# The following lines are desirable for IPv6 capable hosts
-::1 localhost ip6-localhost ip6-loopback
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
+++ /dev/null
-../../../../../requirements.txt
\ No newline at end of file
+++ /dev/null
-testuser ALL=(root) NOPASSWD:ALL
+++ /dev/null
-- hosts: all
- remote_user: testuser
- tasks:
- - name: Reboot host
- sudo: true
- command: shutdown -r now "Ansible updates triggered"
- async: 0
- poll: 0
- ignore_errors: true
- - name: waiting for server to come back
- local_action: wait_for host={{ inventory_hostname }}
- state=started
- sudo: false
-