From 4da982b7a0f5872de2cc721607894216a20892f4 Mon Sep 17 00:00:00 2001 From: pmikus Date: Thu, 13 Apr 2017 20:56:56 +0200 Subject: Update ansible script - Add more inter steps - Add alternative way to host files via Apache server (due to VIRL collisions) Change-Id: Ibb206fa630013e9cdff9cda145e993b033ec7138 Signed-off-by: pmikus --- resources/tools/testbed-setup/README.md | 31 ++++++++++++++++++++-- resources/tools/testbed-setup/ansible_hosts | 19 +++++++++++++ .../testbed-setup/playbooks/01-host-setup.yaml | 4 +-- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 resources/tools/testbed-setup/ansible_hosts (limited to 'resources/tools') diff --git a/resources/tools/testbed-setup/README.md b/resources/tools/testbed-setup/README.md index e795a2e4fc..0a423cc953 100644 --- a/resources/tools/testbed-setup/README.md +++ b/resources/tools/testbed-setup/README.md @@ -27,10 +27,13 @@ is available on the PXE bootstrap server in ~testuser/host-setup. ### Prepare the PXE bootstrap server (one-time) - `sudo apt-get install isc-dhcp-server tftpd-hpa nginx-light ansible` + - edit dhcpd.conf and place it to /etc/dhcp/ + - `sudo cp dhcpd.cfg /etc/dhcp/` + - `sudo service isc-dhcp-server restart` - `cd ~testuser/host-setup` - - `wget 'http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso'` + - `wget 'http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-server-amd64.iso'` - `sudo mkdir /mnt/cdrom` - - `sudo mount -o loop ubuntu-16.04.1-server-amd64.iso /mnt/cdrom/` + - `sudo mount -o loop ubuntu-16.04.2-server-amd64.iso /mnt/cdrom/` - `sudo cp -r /mnt/cdrom/install/netboot/* /var/lib/tftpboot/` - `sudo mkdir /usr/share/nginx/html/ubuntu` - `sudo cp -r /mnt/cdrom/* /usr/share/nginx/html/ubuntu/` @@ -45,6 +48,30 @@ is available on the PXE bootstrap server in ~testuser/host-setup. - `sudo cp boot-screens_txt.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg` - `sudo cp syslinux.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/syslinux.cfg` +### Prepare the PXE bootstrap server (alternative way without NGINX) + + - `sudo apt-get install isc-dhcp-server tftpd-hpa ansible` + - edit dhcpd.conf and place it to /etc/dhcp/ + - `sudo cp dhcpd.cfg /etc/dhcp/` + - `sudo service isc-dhcp-server restart` + - `cd ~testuser/host-setup` + - `wget 'http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-server-amd64.iso'` + - `sudo mkdir /mnt/cdrom` + - `sudo mount -o loop ubuntu-16.04.1-server-amd64.iso /mnt/cdrom/` + - `sudo cp -r /mnt/cdrom/install/netboot/* /var/lib/tftpboot/` + - `sudo mkdir /var/www/download/ubuntu` + - `sudo cp -r /mnt/cdrom/* /var/www/download/ubuntu/` + - `sudo cp /mnt/cdrom/ubuntu/isolinux/ldlinux.c32 /var/lib/tftpboot` + - `sudo cp /mnt/cdrom/ubuntu/isolinux/libcom32.c32 /var/lib/tftpboot` + - `sudo cp /mnt/cdrom/ubuntu/isolinux/libutil.c32 /var/lib/tftpboot` + - `sudo cp /mnt/cdrom/ubuntu/isolinux/chain.c32 /var/lib/tftpboot` + - `sudo umount /mnt/cdrom` + - edit ks.cfg and replace IP address with that of your PXE bootstrap server and subdir in /var/www (in this case /download) + - `sudo cp ks.cfg /var/www/download/ks.cfg` + - edit boot-screens_txt.cfg and replace IP address with that of your PXE bootstrap server and subdir in /var/www (in this case /download) + - `sudo cp boot-screens_txt.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg` + - `sudo cp syslinux.cfg /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/syslinux.cfg` + ### New testbed host - manual preparation - set CIMC address diff --git a/resources/tools/testbed-setup/ansible_hosts b/resources/tools/testbed-setup/ansible_hosts new file mode 100644 index 0000000000..92df915cea --- /dev/null +++ b/resources/tools/testbed-setup/ansible_hosts @@ -0,0 +1,19 @@ +#[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.51.31 virl_l2_end=10.30.51.105 ansible_python_interpreter=/usr/bin/python2.7 +#10.30.51.29 hostname=t4-virl2 virl_l2_start=10.30.51.106 virl_l2_end=10.30.51.180 ansible_python_interpreter=/usr/bin/python2.7 +#10.30.51.30 hostname=t4-virl3 virl_l2_start=10.30.51.181 virl_l2_end=10.30.51.254 ansible_python_interpreter=/usr/bin/python2.7 diff --git a/resources/tools/testbed-setup/playbooks/01-host-setup.yaml b/resources/tools/testbed-setup/playbooks/01-host-setup.yaml index 26c0cdbecd..07bbe4a724 100644 --- a/resources/tools/testbed-setup/playbooks/01-host-setup.yaml +++ b/resources/tools/testbed-setup/playbooks/01-host-setup.yaml @@ -3,8 +3,6 @@ remote_user: testuser sudo: yes tasks: - - name: install python-apt - raw: apt-get update && apt-get install python-apt -y -q - name: copy sudoers file copy: src=files/sudoers dest=/etc/sudoers.d/testuser owner=root group=root mode=660 - name: copy hosts file @@ -19,6 +17,8 @@ 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 -- cgit 1.2.3-korg