Machine Status Change Webhook

This would be very useful in managing automation. Maybe I missed this in the configuration, if so a push in the correct direction would be wonderful with my thanks.

Feature Request:
MaaS makes a Webhook to a global user-defined URI when a machine status changes. For example, when a machine enters Deployment and again when deployment is complete. This should be a POST request with a JSON body containing the new status, former status, timestamp, and the JSON returned by the API endpoint “/MAAS/api/2.0/machines/{system_id}/”.

Example Use Case:
Triggering actions when a new server is created, such as adding the server to an Ansible/AWX inventory, including tags from MaaS, and launching additional workflows based on those tags.
Creating Push notifications (Slack) to alert end users waiting for new Bare Metal or VMs to turn up.
Adding server IP addresses and tags to network management, security, and monitoring systems.

Current Workaround:
Use Cloud-Init User Data to launch a bash script / Ansible-Pull Playbook to extract the system’s IP address and push it to a custom Python FastAPI endpoint. Python script queries MaaS API for all servers, locating the target server with the provided IP address. Python script submits machine information to Kafka or takes direct action.

Many thanks.

hi @cyamato2 ,

Thank you for sharing your ideas :slight_smile: I personally agree with you. It would be nice to be able to add listeners to different events (not only to the machine status).

This feature request will be captured in our internal backlog and might be implemented sooner or later depending on the priorities.