Project

General

Profile

4. Software installation

Creating base node images

First of all, I needed a standard SD card image. I installed a defaut Raspbian on a SD card without any customization and I created an image of it using partclone. the standard Raspbian installation creates 2 partitions : the first one, with a FAT filesystem, containing the Raspberry Pi GPU firmware and the kernel to boot, and the second one which is the root filesystem. So, I have one image for each partition, one file for the SD card MBR, created with dd and one file for the partition table, created with sfdisk. Yes, I know that the partition table is part of the MBR, anyway.

I am now able to clone the default node on each other, but they will all have the same IP and the same hostname. Regarding the IP addresses, I used my network's DHCP server to give a fixed IP address, using the Raspberry Pi MAC address. So, each node has its own IP address and it is fixed, this way I know where is located each node in my box. Regarding the hostname, I created a scripts to clone the SD cards. This script mounts the cloned filesystem to change the hostname in several files (/etc/hostname, /etc/mailname, /etc/hosts, /etc/ssh/ssh_host_*_key.pub, /etc/exim4/update...). Then, when a node boots, it has its own hostname associated with the SD card and its own IP address associated with its MAC address. It is not yet perfect, but enough for my first try.

The cloning script also add an initialization script in /root : install-puppet.sh This one is intended to be executed manually after the first boot. Its goal is to update the system, install puppet, set the puppetmaster server and execute puppet to actually configure the node.

Repositories mirrors

When you update one computer, using a remote internet repository, your network has to download once every file. When you have several computers to update, the amount of download bits is several times the initial amount, the download time also, but they seldom update simultaneously. When you have 15 cluster nodes, they ALL updates simultaneously !!! They kill my network, they use all my internal and external bandwidth, they take more than one hour for their initial update. Well, I do need repository mirrors. I tried to rsync them. Even if Raspbian.org is rsyncable, unfortunately, raspberrypi.org is not... So, I tried to have some consistent mechanisms and chose apt-mirror to mirror the armel and armhf architectures, for wheezy and jessy versions of debian/raspbian. Then, I published the mirrors using the lightweight mini-httpd, which is already an overkill for this simple task !

Puppetmaster server

Also available in: PDF HTML TXT