📜 ⬆️ ⬇️

ERPXE like a magic pill

Greetings

On Habré articles about PXE sometimes flash. This is quite a handy thing for quick deployment of a large number of machines. Recently, specialized packages like Cobbler or OpenQRM have appeared for managing a fleet of servers, but this is not about them. It will be a question of the ERPXE project, designed to ensure the operability of a network of computers. As the creators write about their project - you can apply to any size company. First of all, it allows you to manage the contents of the root tftp. It does this through a system of plug-ins, the number of which is impressive; the list is http://erpxe.org/Category:Plugins . There is almost everything you need and even more. Well, what is not - it is easy to add.

Dealing with ERPXE is easy, well documented. I will try to describe the installation process on FreeBSD, there are no instructions on the site. The project recommends unpacking all archives at the root, but for FreeBSD this is not entirely consistent with ideology. We will unpack in / usr / local and edit everything you need. Given that NFS exports the file system, it is better to make a separate tftpboot.

If the server has a ZFS root file system, then we create file systems for our needs and configure it further in the manual. If UFS, then you have to export / usr to write
')
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 


Further we configure services for work with PXE, as usual, DHCP & TFTP and for ERPXE it is necessary to configure NFS, HTTP and Samba. I assume that these services are configured and working, you only need to make changes for ERPXE. Configuring services makes the script tftpboot / bin / configure.sh. But since we do not have an supported operating system, we’ll review its content and make changes with our hands.

DHCP & TFTP:
For dnsmasq you need the following lines in the config.

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


Restart dnsmasq: service dnsmasq restart

NFS:
We get acquainted with tftpboot / bin / setup / erpxe-exports. We created the images directory earlier with all file systems, create an auxiliary user (adduser erpxe) and assign permissions (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 


Update the folder list: service mountd reload

Http:
For Apache, copy the tftpboot / bin / setup / erpxe-httpd.conf file to /usr/local/etc/apache24/sites/erpxe.conf and replace the paths with those that exist.

 <Directory "/usr/local/tftpboot/er/shares/"> Options Indexes FollowSymLinks Order deny,allow Allow from 192.168.1.0/24 Deny from all </Directory> AliasMatch (?i)^/er(.*) /usr/local/tftpboot/er/shares$1 


Restart service apache24 restart.

Samba:
Adding the erpxe ball to the example 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 state: service samba restart

You can try to boot.

The clean installation already contains Memtest, Hardware Detection Tool, NT Password Editor, etc. But, of course, all the charm of ERPXE in plug-ins, for each of which is described on the wiki installation process. Usually this is unpacking the plugin and copying files from the image to the tftpboot tree. I will not duplicate 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 plugins, you can diagnose hardware (Stresslinux, Inquisitor), back up (Clonezilla, Acronis True Image Home) and, of course, install your favorite distros (CentOS, Ubuntu) over the network.

Source: https://habr.com/ru/post/232095/


All Articles