CSIT-770 Installation of prerequisites on physical hosts 64/8064/2
authorPeter Mikus <pmikus@cisco.com>
Wed, 16 Aug 2017 09:32:13 +0000 (11:32 +0200)
committerPeter Mikus <pmikus@cisco.com>
Wed, 16 Aug 2017 09:35:30 +0000 (09:35 +0000)
- Update ansible to install kubernetes and docker

Change-Id: Ibf57d4fa697f7c9b58f2e4925387b0c4e8b67274
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/tools/testbed-setup/playbooks/01-host-setup.yaml
resources/tools/testbed-setup/playbooks/files/interfaces_physical [new file with mode: 0644]
resources/tools/testbed-setup/playbooks/files/interfaces_virl [moved from resources/tools/testbed-setup/playbooks/files/interfaces with 100% similarity]

index 4401fbb..a9e9989 100644 (file)
@@ -9,8 +9,6 @@
     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
     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
@@ -69,6 +71,8 @@
   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
@@ -89,8 +93,6 @@
     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
   - name: Install lxc
     apt: name=lxc state=present
   - name: Disable 80-vpp.conf
-    command: ln -s /dev/null /etc/sysctl.d/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
diff --git a/resources/tools/testbed-setup/playbooks/files/interfaces_physical b/resources/tools/testbed-setup/playbooks/files/interfaces_physical
new file mode 100644 (file)
index 0000000..734d8cd
--- /dev/null
@@ -0,0 +1,14 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto {{ ansible_default_ipv4["interface"] }}
+iface {{ ansible_default_ipv4["interface"] }} inet static
+    address {{ ansible_default_ipv4["address"] }}
+    netmask {{ ansible_default_ipv4["netmask"] }}
+    gateway {{ ansible_default_ipv4["gateway"] }}
+    dns-nameservers 199.204.44.24 199.204.47.54

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