Thanks to visit codestin.com
Credit goes to github.com

Skip to content

micrometre/ansible-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setting up an event-driven system using Ansible Rulebook to Create and Configure Multipass Vms

Requirements
  1. Ubuntu or Debian with Multipass installed
  1. ansible
  1. 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
  1. 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
  1. 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

Ansible Roles included

  1. multipass
    • Create a Multipass VM
  2. common
    • Update and upgarade System
    • Install required system packages
  3. Users
    • Create a new regular user with sudo privileges
    • Set authorized key for remote user
    • allow 'user ubuntu' to have passwordless sudo
  4. docker
    • Install Docker packages.
    • Install docker-compose-plugin (with downgrade option).
  5. Nodejs
    • Install NVM
    • Install Node

note

About

Event-Driven Ansible with a minimal example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published