Update ansible script 03/6203/3
authorpmikus <pmikus@cisco.com>
Thu, 13 Apr 2017 18:56:56 +0000 (20:56 +0200)
committerPeter Mikus <pmikus@cisco.com>
Fri, 14 Apr 2017 07:35:20 +0000 (07:35 +0000)
- Add more inter steps
- Add alternative way to host files via Apache server (due to VIRL
  collisions)

Change-Id: Ibb206fa630013e9cdff9cda145e993b033ec7138
Signed-off-by: pmikus <pmikus@cisco.com>
resources/tools/testbed-setup/README.md
resources/tools/testbed-setup/ansible_hosts [new file with mode: 0644]
resources/tools/testbed-setup/playbooks/01-host-setup.yaml

index e795a2e..0a423cc 100644 (file)
@@ -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 (file)
index 0000000..92df915
--- /dev/null
@@ -0,0 +1,19 @@
+#[tg]\r
+#10.30.51.16 hostname=t1-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.20 hostname=t2-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.24 hostname=t3-tg1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+\r
+#[sut]\r
+#10.30.51.17 hostname=t1-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.18 hostname=t1-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.21 hostname=t2-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.22 hostname=t2-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.25 hostname=t3-sut1 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+#10.30.51.26 hostname=t3-sut2 isolcpus="1-17,19-35" ansible_python_interpreter=/usr/bin/python2.7\r
+\r
+#By default, let's not touch the VIRL host. Any (unintended) configuration change on VIRL host\r
+#is a recipe for disaster.\r
+#[virl]\r
+#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\r
+#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\r
+#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\r
index 26c0cdb..07bbe4a 100644 (file)
@@ -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

©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.