As there is a lack of information about what is really necessary to run ansible against an OpenWrt host (probably for people who do not want to use a workaround like Gekmihesg's Ansible module ansible-openwrt <- nothing against it by the way), I wanted to share my thoughts and experiences with you.
From the ansible website its surely clear that we obviously need some sort of python version
A good read about what python(3) packages are available on OpenWrt can be found on the OpenWrt Website itself (However I could not find the python-mini or python3-mini yet).
I had time to dig into that and came up with the following ansible role:
This far all of my basic playbooks that I need for OpenWRT were working. Installing openssh-server, creating users, configuring dotfiles for users, ...
Thank you for this list, I always just installed python3 but my devices don't lack storage, so...
Yet I maybe able to lower the minimal requirements for my OpenWrt Ansible collection:
I wrote this collection from scratch and it's already really versatile, meaning the list of supported UCI sections is quite long. I also plan to extend it even further.
I'm working with templates so the configuration files are being written by Ansible. This has the nice effect that they are a bit more tidy in contrast to what you find on regular devices.
All my OpenWrt hosts in my LAN and in data center I manage with this very collection. The documentation currently is German only but I plan to translate it into English, time is rare you know. https://wiki.junicast.de/de/junicast/docs/AnsibleOpenWrtCollection
Can of course be translated with Google and stuff.
@johanneskastl Thats great, thanks for sharing. Did not know about the fact of raw commands and that they do not require python for ansible if I understand it correctly. Its a nice trick and great idea. Thanks a lot. I will keep that in mind and mark it as solution.
Hello @pmisch you are welcome. And thanks a lot for sharing your role. I hope I find time to dig into that. At work I have no limitation of ressources as well but for my home automation you see with my Linksys its getting quite tricky .
I'm sorry python IS required for my Ansible collection. But as you stated you don't have to install the whole and spacy python3 package in order for it to work.
Edit:
Well I just tried that and it didn't work. I had to do opkg install python3 in order for all to work.
No no sorry for misunderstanding, I am pretty sure YOU need python for your role @pmisch , however the previous Post was intended for @johanneskastl because he is using only raw: commands in his role, thats why I was guessing that HE does not need to have python for staging, as it does not make sense otherwise.
I was answering two post at the same time, probably that was a bit confusing
And his solution could probably be integrated in your collection to not install python manually first. Beside of that as a nice side effect having a lower footprint as well.