Privex Server Install System (pvxinstall) ============================== A server provisioning system created for internal use at Privex Inc. Built on the concept of [Hetzner's Installimage tool](https://github.com/hetzneronline/installimage) with original code to suit our specific needs. Some small portions of code have been copied from Hetzner's tool, however our system is not in any way compatible with config files, images etc. for their tool. ### Debootstrap Mirror For Debian based distributions, `debootstrap` tarballs are extracted from a specified NFS share in `debootstrap_conf.sh` to conserve our bandwidth. The script `debootstrap/update_debootstrap.sh` can be used for operating a local mirror of debootstrap tarballs for Debian, Ubuntu, and certain other debian-based distributions. To run your own mirror for the pvxinstall system: **Install NFS** Install the NFS server using the package manager of your distro: ``` apt install nfs-kernel-server ``` Create a folder on your disk to store the bootstrap tarballs, such as `/filesrv/web/images/bootstrap` (the default). ``` mkdir -p /filesrv/web/images/bootstrap ``` Export the folder by placing the below lines into `/etc/exports` and adjusting them for the IP range you would like to allow access to. The below lines allow anonymous read-only access to the specified folder and it's contents from the specified IPv4 and IPv6 subnets. ``` /filesrv/web/images 185.130.44.0/22(ro,sync,nohide,no_subtree_check,insecure,all_squash) /filesrv/web/images 2a07:e00::/29(ro,sync,nohide,no_subtree_check,insecure,all_squash) ``` Run this command to refresh the NFS exports: ``` exportfs -r ``` To test that your NFS share works, mount it from a Linux system on the allowed IP range: ``` # NFS utilities to mount NFS shares apt install -y nfs-common sudo mkdir /mnt/nfs sudo mount -t nfs YourServerIpOrHostname:/filesrv/web/images /mnt/nfs # $ ls -l /mnt/nfs # total 0 # drwxrwxrwx 1 www-data www-data 24 Jan 25 08:06 images ``` Notice: If your NFS share contains different filesystems, including btrfs/zfs subvolumes, you will need to have an export line for the individual subvolume folders, otherwise NFS will show the folder as owned by root and it will appear to be empty. **Adjust debootstrap config** Adjust the file `debootstrap_config.sh` to your needs, be aware that both the client and the server require the same config file, otherwise packages may not get installed correctly on the target system(s). You may also wish to adjust `update_debootstrap.sh` with the bootstrap folder to place the tgz files in, local package mirrors, as well as the CPU architectures and releases that you want to mirror (e.g. ubuntu xenial, debian stretch). **Run the script** Simply run `./update_debootstrap.sh` (may need to be root), and it will create the directory structure in the folder specified in `update_debootstrap.sh`, as well as build the debootstrap tgz files including the packages you've specified in the config file. **Point init.sh to your server** For the installation system to connect to your NFS server, you'll need to adjust `init.sh` with your server's hostname/IP and the full path to the share (e.g. /filesrv/web).