- Ubuntu or Debian with Multipass installed
- ansible
- Install necessary software:
- Install Java, Python, pip3, and the required Ansible packages.
sudo apt-get --assume-yes install openjdk-17-jdk python3-pip
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$PATH:~/.local/bin
pip3 install ansible ansible-rulebook ansible-runner
- Start the Ansible Rulebook engine: Run the ansible-rulebook command to start listening for events.
ansible-rulebook --rulebook webhook-example.yml -i inventory/inventory.yml --verbose
- Trigger an event: Send a POST request to the specified endpoint. This will trigger the execution of the defined Ansible playbook, demonstrating a simple event-driven automation scenario.
curl -H 'Content-Type: application/json' -d "{\"message\": \"Ansible is super cool\"}" 127.0.0.1:5000/endpoint- multipass
- Create a Multipass VM
- common
- Update and upgarade System
- Install required system packages
- Users
- Create a new regular user with sudo privileges
- Set authorized key for remote user
- allow 'user ubuntu' to have passwordless sudo
- docker
- Install Docker packages.
- Install docker-compose-plugin (with downgrade option).
- Nodejs
- Install NVM
- Install Node