a54360890b74d4f74ddc756b441b40d80c4473f9
[csit.git] / resources / tools / testbed-setup / playbooks / 01-host-setup.yaml
1 ---
2 - hosts: all
3   remote_user: testuser
4   sudo: yes
5   tasks:
6   - name: copy sudoers file
7     copy: src=files/sudoers dest=/etc/sudoers.d/testuser owner=root group=root mode=660
8   - name: copy hosts file
9     template: src=files/hosts dest=/etc/hosts owner=root group=root mode=644
10   - name: copy hostname file
11     template: src=files/hostname dest=/etc/hostname owner=root group=root mode=644
12   - name: interfaces file
13     template: src=files/interfaces dest=/etc/network/interfaces owner=root group=root mode=644
14   - name: copy grub file
15     template: src=files/grub dest=/etc/default/grub owner=root group=root mode=644
16   - name: update grub
17     command: update-grub
18   - name: copy apt sources file
19     template: src=files/apt-sources.list dest=/etc/apt/sources.list
20   - name: install python-apt
21     raw: apt-get update && apt-get install python-apt -y -q
22   - name: update repositories
23     apt: update_cache=yes
24   - name: install git
25     apt: name=git state=present
26   - name: install crudini
27     apt: name=crudini state=present
28   - name: install expect
29     apt: name=expect state=present
30   - name: install socat
31     apt: name=socat state=present
32   - name: install qemu
33     apt: name=qemu-system-x86 state=present
34   - name: Old interface naming
35     command: ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
36   - name: update init for old interface naming
37     command: update-initramfs -u
38 - hosts: virl
39   remote_user: testuser
40   sudo: yes
41   tasks:
42   - name: Add VIRL user
43     user: name=virl shell=/bin/bash comment="VIRL user" password="$6$mJPlK5FKLar6$xxXPP0LRhC7T1yhHtym18Z3nKZweTtfTxzi1WpvVHJ0U/Em1UWcHqfMhRApFp0rsY9jHRuL6FfeFbKPN..uDK."
44   - name: Add VIRL user to sudoers
45     copy: src=files/sudoers_virl dest=/etc/sudoers.d/virl owner=root group=root mode=660
46   - name: Set VIRL user authorized key
47     authorized_key: user=virl key="{{ lookup('file', '/home/testuser/.ssh/id_rsa.pub') }}"
48   - cron:
49     name: QEMU log garbage collector
50     minute: 0
51     hour: 0
52     job: "find /var/log/libvirt/qemu -type f -mtime +14 -name 'instance*.log' -delete"
53   - cron:
54     name: VPP deb package garbage collector
55     minute: 0
56     hour: 0
57     job: "find /tmp -type f -atime +14 -name '*.deb' -delete"
58   - cron:
59     name: VPP rpm package garbage collector
60     minute: 0
61     hour: 0
62     job: "find /tmp -type f -atime +14 -name '*.rpm' -delete"
63   - cron:
64     name: NFS scratch dir garbage collector
65     minute: 0
66     hour: 0
67     job: "find /nfs/scratch/ -type d -mtime +1 -name 'session-*' -exec rm -r "{}" \;"
68 - hosts: tg:sut
69   remote_user: testuser
70   sudo: yes
71   tasks:
72   - name: copy sysctl file
73     template: src=files/90-csit dest=/etc/sysctl.d/90-csit.conf owner=root group=root mode=644
74   - name: isolcpus and pstate parameter
75     lineinfile: dest=/etc/default/grub regexp=^GRUB_CMDLINE_LINUX= line=GRUB_CMDLINE_LINUX="\"isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} intel_pstate=disable\""
76   - name: update grub
77     command: update-grub
78   - name: Install python-dev
79     apt: name=python-dev state=present
80   - name: Install python-virtualenv
81     apt: name=python-virtualenv state=present
82   - name: Install python pip
83     apt: name=python-pip state=present
84   - name: Install libpcap-dev
85     apt: name=libpcap-dev state=present
86   - name: Install cpufrequtils
87     apt: name=cpufrequtils state=present
88   - name: Set cpufrequtils defaults
89     copy: src=files/cpufrequtils dest=/etc/default/cpufrequtils owner=root group=root mode=0644
90   - name: Disable IRQ load balancing
91     copy: src=files/irqbalance dest=/etc/default/irqbalance owner=root group=root mode=0644
92   - name: Pinning of IRQs
93     command: for l in `ls /proc/irq`; do echo 1 | sudo tee /proc/irq/$l/smp_affinity; done
94   - name: Disable ondemand
95     service: name=ondemand enabled=no
96   - name: Install cgroup-support
97     apt: name=cgroup-bin state=present
98   - name: Install zlib1g-dev
99     apt: name=zlib1g-dev state=present
100   - name: Copy Python requirements file
101     copy: src=files/requirements.txt dest=/tmp/requirements.txt
102   - name: Install PIP requirements
103     pip: requirements=/tmp/requirements.txt
104 - hosts: tg
105   remote_user: testuser
106   sudo: yes
107   tasks:
108   - name: Install unzip
109     apt: name=unzip state=present
110 - hosts: sut
111   remote_user: testuser
112   sudo: yes
113   tasks:
114   - name: Install dkms
115     apt: name=dkms state=present
116   - name: Install pkg-config
117     apt: name=pkg-config state=present
118   - name: Install libglib2.0-dev
119     apt: name=libglib2.0-dev state=present
120   - name: Install autoconf
121     apt: name=autoconf state=present
122   - name: Install libtool
123     apt: name=libtool state=present
124   - name: Install screen
125     apt: name=screen state=present
126   - name: Disable 80-vpp.conf
127     command: ln -s /dev/null /etc/sysctl.d/80-vpp.conf

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.