Connecting ansible to Arduino

I am just starting to explore in Ansible. In my project, i am installing ansible in a raspberry pi to make it as controller node and i will be controlling the raspberry pi fleet (in one container with kubernetes) from the controller node with ansible. I wonder, same thing can be done with arduino or not. I want to automate the firmware update, switching on and off on regular intervals and etc.

If there are CLI tools available to do what you want, then it can be done using Ansible too. “Switching on and off” is usually not under control of the device itself though, that’s going to be some other system to control power to the device.

Absolutely! You can talk to anything with an API. If there’s an external API, there’s various methods depending on the way that you “talk to the device” and as I understand it this is often specific to the model of Arduino that you have.

An example of interfacing with a device that is more or less a microcontroller is the community.cip collection which uses the Common Industrial Protocol to talk to Programmable Logic Controllers behind a backplane. Also, if you’re looking to talk to something over a REST API via http(s), then you could write a httpapi connection plugin which allows you to write tasks in a playbook against a set of hosts that aren’t actually hosts but instead REST API endpoints. The consoledot.edgemanagement is an example of that in action. I’m happy to help where I can, I’ve worked on both types of automation implementation. :slight_smile:

3 Likes