Automated configuration : Bash script vs. Ansible ?


I’ve been using OpenSUSE Leap with KDE on all my desktop installations since the 15.0 release, and I’m quite happy with it. On the latest count, I’m managing about 50 desktop client machines with this setup, including my own workstation and laptop. I’ve written a more or less bone-headed Bash script to automate the post-install configuration process:

On a side note, I’m using a similar shell script for setting up my servers running Rocky Linux 8.4:

Now I wonder if I should replace this bone-headed setup by Ansible. I have yet to learn it, but I don’t know if it’s really worth the hassle. As far as I understand, it’s a quite complex technology.

Any advice on this subject ?

While I normaly do not try to understand otherones complete scripts (only extract they show with problems), I did look into this one. On line 14 it says:


I doubt this works as intended by you.

henk@boven:~> echo $pwd


You probably want:

henk@boven:~> echo $PWD

BTW, the script looks nicely formatted :good:


About your question I can not say much. I have no idea what Ansible is.

What a great idea! I’ve downloaded a copy of your script and, although I have a lot to learn, I think I’ll be able to get it to work for what I want to do. Thank you very much for posting it.


I have to say I don’t know Ansible. FWIW, have you ever looked into AutoYaST?

It may not cover all the details as your impressive script but it’s openSUSE native and AFAIR quite easy to use.

$pwd is not the same as $(pwd)

Oh boy…:shame::shame:

I already wondered why you could not have detected that and the script still functioning.

:shame::shame: again.

I was doing everything via a script like yours (not as nicely formatted) and then I decided to learn some Ansible recently. I have only been using Ansible for a couple of weeks (most of that time making config files and setting it up) and I have been loving it so far. The yaml files are a lot easier to learn and write up than Bash scripting because everything is more like reading a grocery list of tasks and services. The daunting part isn’t really with the yaml files and more the Ansible syntax (there is a lot to remember/learn). The basics of it, enough to get started, wasn’t too bad for me. Took me about a week and a half to get the basics down to be able to push deploy my new apache2 server. I would recommend looking into Ansible. It has been loads of fun learning and there is still much more learning to go!