[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Thoughts on Anible?



Please forgive my goofy questions. I am not really that well versed in CM (Configuration Management) and this post is really going to show it.

Because this will more than likely be tltr (too long to read), I'll try to make it as fun as possible. Forgive if my humor is a bit strange.

I noticed "Anible" isn't in the debian repos. Seems to be a Red Hat scripting engine for creating automated installs.

I wrote my own automated install script in Bash. Crude but worked. It didn't run as root (but would ask for sudo password if a command required it), and it ran on the machine that was to use apt-get and install packages, sed for editing configs, etc. Like I said, crude.

I'm currently learning Python (as in writing something while learning at the same time). So I'm re-writing my Bash script in Python as a practice project to learn from, and making it more general so I can use it with anything. I'm still in the process of creating the library of functions that will do the stuff like unzipping/untaring, installing packages, making directories, updating configuration files, etc. So far, it's really a lot easier than doing it all in Bash and I'm enjoying the learning process. It's going very well, actually.

I heard about "Ansible" and how it is supposed to make it easier to write installation scripts.

I took a look at the Ansible site's Quick Start video and was like 'huh?' 'what?' "what just happened??" "What is he DOING??" I couldn't even decipher what he was saying, either (and English is my mother language). Then my eyes nearly popped out of my head. "Why in the blue blazes is he running this script on ONE machine, then ssh'ing into another machine as ROOT nonetheless and doing stuff on that remote machine as root via this scripting engine on the first machine? Isn't that supposed to be a big no-no or something??" I was thinking that's a lot of work to do when all you could do is write a Python (or bash) script and run it on the machine it's to install stuff on, then remove the script when done, and not have to ssh in as root! I felt too uncomfortable with the way the video was going about things.

Oh wait. He installs Ansible on the machine he just ssh'ed into as root and is running the script via Ansible on that machine. Ok, now that I think about it, how do you make sure all of Ansible is removed when done? I would at least want to uninstall Ansible afterwards so someone can't break in and use it to screw up the system. But then again, would they be able to?

I googled and saw that to make a directory using Ansible, you need to remember and write several lines in the YAML script. In python, it seems only one line was needed to create a directory (and with permissions).

I tried looking at Ansible's documentation. I recoiled worse than a (wait for it) Python! I'm one that learns by doing, not by reading "War and Peace" (which like this post, is tltr)!

My bash script (and python script) both run as current user and beep then ask for a sudo password whenever it needs to run something as sudo (if the sudo time hasn't timed out). It does the task as sudo and then goes on to the next task (which may or may not be sudo - if it's not, then it doesn't use sudo or root). So much of the script is run NOT as root/sudo. I assumed that is the best way to go about it? Also my script has colored output and a log file I can look at to see what got installed, when and where and how, or why something didn't get done, or edited, installed, etc.) The Ansible video only showed something was done but not what, and an IP address (which is not something useful in my situation).

For some strange reason, I'm finding my script easier to use and Python easier to write than trying to figure out Ansible. Besides, Python and Bash come pre-installed anyway.

Am I goofy or what? Someone please talk me into using Ansible. It seems googling, many people sing it's praises, but I'm not getting it for some reason. I'm petrified of that thing! I'm enjoying the process of learning Python, though.

Should I learn Ansible as well? Would it be a good skill? Or is it OK to just skip that idea and continue doing things my old-fashioned way using what's already there - bash or python?

I would like to have some decent linux development skills. I do know Perl quite well, and Bash I'm pretty decent at for the most part. I can write in C or C++ (and get myself in trouble, as you'd imagine). :)

Should Ansible be added to my list? Or do devs recommend something else?

(I am wondering if the "user" mailing list is even the right place to ask?)


Reply to: