Files
tp2_ansible/run_demo.md
2025-02-03 15:03:45 +01:00

792 B

demoAnsible

Setup

  • Install vagrant
  • Install ansible
  • Install Virtualbox (if libvirt provider is not used)

Start the VMs using vagrant

# Choose between libvirt and virtualbox depending on your provider
cd vagrant/libvirt  
cd vagrant/virtualbox

# Start the VMs
vagant up
# Check that the VM are up
# Check that you can login using ssh (ssh vagrant@192.168.56.141 # password: vagrant)

Demo 1

  • Run the playbook (verify that playbook parameters match your VMs)
ansible-playbook playbook.yml -i hosts

Try to access http://192.168.56.141/index.php

Demo 2

  • Kill the VMs and remove them.

  • Use vagrant to recreate them from scratch

  • Run the playbook

ansible-playbook site.yml -i hosts

Try to access http://192.168.56.141/index.php