Playbook to install and configure a PXE boot server for your local environment.
- Ansible
- Two machines/virtual machines:
-
Machine Minimum Specs:
- PXE Server:
- 2 vCPUs
- 2 GB RAM
- 60 GB Disk
- Partitions:
Name Size (GB) / 9 /boot 1 /boot/efi 1 /home 4 /tmp 4 /var 28 /var/log 4 /var/log/audit 4 /var/tmp 4
- Partitions:
- Test Server:
- 2 vCPUS
- 2 GB RAM
- 40 GB Disk
- Partitions:
Name Size (GB) / 10 /boot 1 /boot/efi 1 /home 8 /tmp 4 /var 4 /var/log 4 /var/log/audit 4 /var/tmp 4
- Partitions:
- PXE Server:
-
Note: I suggest installing a hypervisor and using virtual machines. Here's a list of common affordable hypervisors
- HyperV (Windows)
- KVM (Linux)
- VirtualBox (Cross Platform)
-
- OS images to offer as PXE boot options
- Kickstarts for images to offer as PXE boot options
- Clone Repository
git clone https://github.com/danagarcia/linux-automation.git
- Edit Inventory
cd linux-automation vi ansible/inventory
- Replace: 192.168.86.46 with the IPv4 address of the server you want to serve as a PXE boot server
- Edit Variables
cd linux-automation vi ansible/playbooks/configure-pxe-server.yml
- Update values to match your configuration for variables:
- host -> vars -> images
- host -> vars -> dhcp_config
- Update values to match your configuration for variables:
- Generate SSH Key
ssh-keygen -b 4096
- Add Key to Authorized Keys
ssh-copy-id -i ~/.ssh/<name-of-your-key>.pub <username-for-pxe-machine>@<ipv4-address-for-pxe-machine>
- Replace vaalues between <>
- Update Ansible Config
Update values for remote_user and private_key_file
vi ansible/ansible.cfg
- Create Ansible Temp Directory
ssh <username-for-pxe-machine>@<ipv4-address-for-pxe-machine> -i ~/.ssh/<name-of-your-key> sudo mkdir /var/ansible chmod 777 -R /var/ansible exit
- Run Playbook
ansible-playbook ./playbooks/configure-pxe-server.yml --become --ask-become-pass
- You will be prompted for the password of the remote user account. This is to evelate to root as many steps require it.
- Watch The Magic
- Launch PXE Boot on Test Machine
- Select Image
- Watch The Magic