I see Ansible as necessary evil. Not requiring server-side installed tools to work is great. But choosing yaml of all things for playbooks is downright vile. So there's nothing casual about administering that many servers and machines, especially with constant warnings about Python version incompatibility.
If we ever meet an advanced alien society, I really want to see what solutions they came up with for:
Configuration languages
GUI frameworks
Because those two areas seem like there will never be a "perfect" solution.
And to anyone that says "an alien society might be so different that they don't have those things", I think if you've invented computers then at some point you will want some way to configure them, and some way to interact with programs running on them.
If they navigate programs entirely by sound or some shit, that'd still be interesting to see.
Watch it turn out that most advanced alien societies just use the terminal.
Then it turns out the reason they are exploring the depths of space is to see if any other civilizations have figured out a better way to handle those things because their current solutions work but kinda suck (along with several other problems we can't yet fathom). And worse, they get excited when you start describing our systems.
"Wait wait wait, please tell me more about this... stack... that allows you to reuse code with different initial values for variables. That sounds revolutionary!"
Excellent observation. I'm honestly surprised there's no well-known "universal parser" for common languages that can handle JSON, YAML, TOML, maybe even some form of XML, etc.
I don't particularly like yaml as a data storage language because of its use of significant whitespaces, but for the minimal complexity of my own playbooks, I don't mind it.
What would you consider to be an ideal language for playbooks?
Am not sure to be honest. I always liked JSON even though it's very rigid. Even so, most of software I write stores config in JSON simply because it's easy to parse and it's supported by literally everything. It's also pretty minimalist.
Perhaps something more strict and defined would be better. I think I'd even prefer XML to YAML.
Its syntax is plenty when it comes to "wrong". I've been using it for a while now and I still run into some issue with its formatting, but that of course can only be discovered when you run deployment or provisioning scripts, giving it high chance of pissing me off because it will cause something to be half-configured when it shouldn't be.
You know, for how stale its entire idea is, Ansible isn't bad. I code fucking yaml daily.
Having said that, It's a generation behind its competition on terms of everything except calendar age. Fuck's sake, it grew from the same incubator that spawned mgmtConfig, which is as better than chef/cinc/salt/puppet as those are better than ansible. It was born with its own grandson, if there was any shared dna.
Using Ansible is like working with Unfrozen Caveman Lawyer. Each day it grows more clunky, more waddling with the bags on its side, more obsolete. It's the 50-foot coiled rj-12 cable of config management.
For us Ansible works and code that we have is getting dated now, but every now and then it does get a little bit of refresh to give it more life but in general you are right. Its bad sides mainly show up when you try to manage older systems or something more exotic. Then python incompatibilities, directories and server side libraries all start showing their ugly side.
And all of them are universally bad. Especially all the Kubernetes tools, Helm is so bad and at least half of it is due to the combination of YAML and templating.
Isn't all of these tools dying with k8s? Like the entire concept of installing a playform for your service is moot at this point. Plus there's like a million other benifits over bare metal configs.
Nope. Far from it, especially if you have to adapt to existing structure, like having sites hosted with Plesk or cPanel on some rented hosting service. I've been also using it for easy and fast configuration of embeded devices, like RaspberryPi and similar.
I love Ansible while hating when people touch it. Yes, it’s very flexible but at what cost? If you actually learn it and follow some basic guidelines, you can make beautiful playbooks and inventories having wonderful automation for even complex setups while keeping it clean. But if one doesn’t care and just try to make servers go brrr, it becomes horrific glorified shell script with everything hardcoded, most tasks unaware of changes they make, cesspool of shitty templates, breaking itself in minutes, being pain to work with and making me want to delete all the shit and start all over.
I decided I wanted nothing to do with Ansible when I was half an hour into reading the website and I still didn't have a fucking clue what it is or exactly what it does.
To this day, I couldn't really tell you. It seems to be basically a framework for automatically SSH'ing into machines and running shell scripts on them which doesn't sound robust in the slightest. It's like they took thirty years of sysadmins' discarded spit-and-duck-tape solutions and bundled them into a "framework".
I dunno how the fuck you're supposed to manage cloud infrastructure at scale with that.
Terraform for day 0 operations is a better experience but it had its quirks. Ansible is nice when it's done well, but when you don't have an Ansible module for something, you're essentially writing a shell script
It’s far more than just SSHing and running shell scripts. Besides, I wouldn’t ever call it a „framework”.
It’s a tool for Linux, BSDs and even Windows machine setup automation in a declarative fashion. Tasks are usually built out of wide range of provided modules for both universal actions (like file edits, templating, shell commands) and very specific ones (like Podman containers, Postgres users, indexes in Mongo, whatever you imagine, you can even implement your own in Python). Those tasks have logic that can detect the status for each of the tasks in each specified nodes, so they can not only be applied, but also dry run with precise diff tracking (diff of config files to be applied, packages to be installed, etc).
It has inventory that can be both static (config file), and dynamic (e.g query an AWS account for Ec2-s or get nodes from Proxmox) that lets you group your however many hosts (by purpose, etc), attach variables to specific hosts or entire groups, or even store encrypted credentials to use them in roles. When dealing with hundreds of hosts, at some point this is something you need to do anyway, but here it really shines even with much smaller amount of machines.
Ansible can be very reliable and provide awesome environments, but it requires some learning and due to its flexibility, it can also be used badly. I have some success stories with it in last 7 years of utilizing it for both small and big business.
That being said, if you want some magic hammer that just does stuff without requiring any understanding, Ansible might not be the thing.
And no, Terraform is not an replacement for Ansible and vice versa. Those two are designed for different purposes. I actually used them together in some projects.
Yup. I used ansible for a good year, maybe two, and found myself asking, "Why the fuck am I maintaining some abstract thing when I can just write a shell script and deploy that?"
Cloud orchestration is better done with other tooling. Honestly don't see a use case for ansible beyond physical data center deployments.
Terraform talks to "clouds", where as Ansible talks to devices. Whilst clouds do have many devices, I feel like Ansible has a greater ability to absorb likeness/distinctiveness (ships), over a greater scale than terraform.