ERPXE like a magic pill

Greetings!

Articles about PXE sometimes flash on Habré. This is quite a convenient thing for the rapid deployment of a large number of machines. Recently, specialized packages like Cobbler or OpenQRM for managing a fleet of servers have appeared, but we will not talk about them. We will talk about the ERPXE project, designed to ensure the availability of a network of computers. As the creators write about their project, you can apply it to any company of any size. First of all, it allows you to manage the contents of the tftp root. It does this through a system of plugins, the number of which is impressive, the list is http://erpxe.org/Category:Plugins . There is almost everything that may be needed and even more. Well, and what is not - it’s easy to add.

Dealing with ERPXE is easy, well documented. I will try to describe the installation process on FreeBSD, there is no instruction on the site. In the project, it is recommended to unpack all the archives in the root, but for FreeBSD this does not quite correspond to the ideology. We will unpack it in / usr / local and edit everything that is needed. Considering that NFS exports the file system, it is better to make a separate one for tftpboot.

If the server has a ZFS root file system, then we create file systems for our needs and configure it further according to the manual. If UFS, then you have to export / usr for writing

zfs create -o compression=lz4  -o exec=off -o setuid=off -o mountpoint=/usr/local/tftpboot zroot/tftpboot
zfs create -o compression=lz4  -o exec=off -o setuid=off -o mountpoint=/usr/local/images zroot/images
zfs create -o compression=lz4  -o exec=off -o setuid=off -o mountpoint=/usr/local/images/dev zroot/images/dev


Then we take the main archive

http://www.erpxe.com/download/

Unpack it:

cd /usr/local
tar -xzf erpxe.current.tar.gz


Next, we configure the services to work with PXE, as usual, DHCP & TFTP and for ERPXE you need to configure NFS, HTTP and Samba. I assume that these services are configured and working, you only need to make changes for ERPXE. Services are configured by the tftpboot / bin / configure.sh script. But since we do not have a supported operating system, we will familiarize ourselves with its contents and make changes by hand.

DHCP & TFTP:
dnsmasq needs the following lines in the config.

dhcp-boot=pxelinux.0
tftp-root=/usr/local/tftpboot/


Restart dnsmasq: service dnsmasq restart

NFS:
Get to know tftpboot / bin / setup / erpxe-exports. We created the images directory before with all file systems, create an auxiliary user (adduser erpxe) and assign rights (chown erpxe / usr / local / images / dev), add lines to / etc / export:

/usr/local/images -mapall=nobody -ro -network=192.168.1.0/24
/usr/local/images/dev -mapall=erpxe -network=192.168.1.0/24
/usr/local/tftpboot/er/shares -alldirs -mapall=nobody -ro -network=192.168.1.0/24


Updating the list of folders: service mountd reload

HTTP:
For Apache, you need to copy the tftpboot / bin / setup / erpxe-httpd.conf file to /usr/local/etc/apache24/sites/erpxe.conf and replace the paths with the ones you have.


    Options Indexes FollowSymLinks
    Order deny,allow
        Allow from 192.168.1.0/24
        Deny from all

AliasMatch (?i)^/er(.*) /usr/local/tftpboot/er/shares$1


Restart service apache24 restart.

Samba:
Add an erpxe ball as exemplified in the tftpboot / bin / setup / erpxe-smb.conf file

[erpxe]
        path = /usr/local/tftpboot/er/shares/
        comment = Guest access share
        browseable = yes
        read only = yes
        guest ok = yes


Update status: service samba restart

You can try to boot.

In a clean installation, Memtest, Hardware Detection Tool, NT Password Editor, etc. are already present. But, of course, the whole charm of ERPXE is in plug-ins, for each of which the installation process is painted on the wiki. Usually this is unpacking the plugin and copying files from the image to the tftpboot tree. I will not duplicate the information from the wiki here, the only thing worth paying attention to is that some plugins require changing the IP in the menu file.

After installing the plug-ins, you can carry out hardware diagnostics over the network (Stresslinux, Inquisitor), backup (Clonezilla, Acronis True Image Home) and, of course, install your favorite distributions (CentOS, Ubuntu).

Also popular now: