aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/playbooks/01-host-setup.yaml
blob: a54360890b74d4f74ddc756b441b40d80c4473f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
- 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: interfaces file
    template: src=files/interfaces dest=/etc/network/interfaces 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: 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
- hosts: virl
  remote_user: testuser
  sudo: yes
  tasks:
  - 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: Set VIRL user authorized key
    authorized_key: user=virl key="{{ lookup('file', '/home/testuser/.ssh/id_rsa.pub') }}"
  - cron:
    name: QEMU log garbage collector
    minute: 0
    hour: 0
    job: "find /var/log/libvirt/qemu -type f -mtime +14 -name 'instance*.log' -delete"
  - cron:
    name: VPP deb package garbage collector
    minute: 0
    hour: 0
    job: "find /tmp -type f -atime +14 -name '*.deb' -delete"
  - cron:
    name: VPP rpm package garbage collector
    minute: 0
    hour: 0
    job: "find /tmp -type f -atime +14 -name '*.rpm' -delete"
  - cron:
    name: NFS scratch dir garbage collector
    minute: 0
    hour: 0
    job: "find /nfs/scratch/ -type d -mtime +1 -name 'session-*' -exec rm -r "{}" \;"
- hosts: tg:sut
  remote_user: testuser
  sudo: yes
  tasks:
  - 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: Pinning of IRQs
    command: for l in `ls /proc/irq`; do echo 1 | sudo tee /proc/irq/$l/smp_affinity; done
  - 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
- 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: Disable 80-vpp.conf
    command: ln -s /dev/null /etc/sysctl.d/80-vpp.conf