Milestone 7 ‐ Deploying and Post Provisioning of BlueX Linux Servers - ryanm292002/SEC480 GitHub Wiki
7.1
-
Download Rocky ISO (https://rockylinux.org/download/)
-
Go to ESXI, Upload the iso to datastore, register a new VM and create the base VM for Rocky.
-
Run the script found @ https://raw.githubusercontent.com/gmcyber/RangeControl/main/src/scripts/base-vms/rhel-sealer.sh
-
Sudo yum install wget
-
Wget 'https://raw.githubusercontent.com/gmcyber/RangeControl/main/src/scripts/base-vms/rhel-sealer.sh'
-
Create base snapshot
-
Create a deployer user aswell on the 3 boxes
- adduser deployer
- passwd deployer
- usermod -aG wheel deployer
7.2
(Adding static route to the blue network on 480-fw)
-
Firstly my 480-fw is on pfsense so the setup is a little different.
-
Add gateway in the webconfig of pfsense: Systems > routing > gateways > Add+
- Lan
- Name=bluefirewallroute
- Gateway=10.0.17.200
- Add static route Systems > routing > static routes
- destination network = 10.0.5.0/24
- Gateway = bluefirewallroute
-
Create the new inventory file // playbook for provisioning DHCP Playbook link: https://github.com/ryanm292002/SEC480/blob/main/ansible/vyos-blue.yml Inventory yaml file: https://github.com/ryanm292002/SEC480/blob/main/ansible/fw-blue1-vars.yaml
-
Run the playbook, go to blue fw and run config, show service to see the new dhcp information added for reference
-
Creating 3 rocky clones that grab dhcp address from the new blue pool created on bluefw:
- Use cloner function x3 and create rocky-1, rocky-2 and rocky-3
-
Run network-adapt function x3 to change the network adapters of the 3 machines to the bluenetwork so they can grab from newly created dhcp pool
-
run get-ip to test the 3 machines have properly grabbed a new ip
7.3
inventory file: playbook:
-
add a public key for the deployer user
-
Create a sudoers drop-in file for no password elevation to root by deployer
-
change the hostname
-
change the dhcp ip address to static (10.0.5.10,11,12)
-
Turn off the machines and create a safety before ansible snapshot before continuing with the rocky boxes
-
Ensure deployer user was created and in sudo group
- Create ssh key on mgmt box to put into ansible inventory file (vars section)
-
Paste the ssh key into the public_key variable inside of the inventory file
-
Run the rocky playbook with the linux inventory file which will add ubuntu in 7.4
7.4
-
Create 2 new ubuntu boxes with the cloner function, make sure to put on the blue network and they should grab dhcp addresses automatically.
-
Created the default user as "rangeuser" on the ubuntu base vm
-
Cat the netplan and copy it over as a template to j2 file on mgmt box
-
Cloned machines will grab same dhcp address if machine-id isnt deleted:
sudo rm /etc/machine-id
sudo systemd-machine-id-setup
sudo reboot
- All that was really changed from the rocky playbook was the netplan configuration which was a little different from rocky which uses nmcli:
-
Added ubuntu boxes to inventory file under 'ubuntu'
-
Run the play book