Skip to content

estenrye/ansible-rancher-lab

Repository files navigation

Ansible Lab

Network Diagram

ansible rancher lab network diagram

Host Machine Setup

  1. Enable Hyper-V
  2. Install Vagrant
  3. Install Git
  4. Add your user to the list of Hyper-V Administrators. This will allow you to use vagrant without opening an Administrative PowerShell prompt.
  5. Clone repo using git clone git@github.com:estenrye/ansible-rancher-lab.git

Launching the Ansible Control Server and Lab Router

The vagrant driver for Hyper-V lacks two components that allow us to have a predictable lab setup. The first is that the Hyper-V vagrant driver does not provide a mechanism for specifying multiple Network Interface Adapters on a guest VM. The second is that the Hyper-V vagrant driver does not provide a mechnanism for specifying a static IP address for a guest VM on any network type. This project addresses the first problem by using a combination of vagrant commands and PowerShell commandlets to add a second Network Interface Adapter to the router guest VM. It addresses the second by dynamically generating the inventory on the host machine and copying it to the acs guest VM.

  1. ./scripts/OneTimeSetup.ps1
  2. vagrant up openvas router
  3. vagrant halt router
  4. Add-VMNetworkAdapter -VMName router.rz.lab -SwitchName Private -Name LAN
  5. Start-VM router.rz.lab
  6. ./scripts/Generate-Ansible-Inventory.ps1
  7. vagrant ssh openvas -c "ansible-playbook -i inventory --become playbooks/network.yml"
  8. vagrant up acs utility dc docker-manager docker-worker
  9. vagrant ssh acs -c "ansible-playbook -i rz_lab_inventory --become playbooks/net-plan.internal.yml"
  10. vagrant ssh acs -c "ansible-playbook -i rz_lab_inventory --become playbooks/site.yml"
  11. Wait for ELK Stack to fully deploy and initialize before proceeding. http://utility.rz.lab:5601
  12. vagrant ssh acs -c "ansible-playbook -i rz_lab_inventory --become playbooks/beats.yml"

References

Much of this project wouldn't be, if not for the great contributions of others. Please check out their sites in the references.

About

Repository for my local rancher lab.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published