5 ms·
I have mad respect for Jeff. I really, really, HATE Ansible. There is a special place in hell where all the worst of humanity go. It's a room where you must b
by 0xbadcafebee 3y ago
I have mad respect for Jeff.
I really, really, HATE Ansible.
There is a special place in hell where all the worst of humanity go. It's a room where you must build either Ansible or Jenkins infrastructure, for eternity.
Since Jeff is a professional, I am assuming his book does not detail the myriad ways in which Ansible is just fucking horrifically designed and a nightmare to use. Where the docs are usually missing or incomprehensible. Where important features seem to just not exist. Where barely anything works - but when it does, it works in a totally asinine way, that you will spend hours figuring out. Even if you've done it before. Or the nightmare that is trying to debug it, or use it with modern cloud infra and best practices.
Sometimes - rarely - Ansible is an OK solution. It's more lightweight than its competition in the configuration management space, and it can be portable, if you add all the portability yourself. Well-maintained Galaxy stuff is quite useful and can save you weeks of time and years of therapy.
But for the most part, it and its Configuration Management brethren are better left for systems where someone is manually monkeying with them and breaking them, and you need something automated that also has some dependency-tracking to fix complex things for you.
The Cloud is still, sadly, mostly not immutable. So we still need shitty "orchestration" (Configuration Management) tools to maintain it. But I really hope they go away. I have never seen a Configuration Management tool that I have liked, because their very concept is automated duct tape.
(my bona fides: 20 years operating large-scale systems, including a reimplementation of DynamoDB, which was powered by OpenStack and AWS infra scaled dynamically by Ansible playbooks. I. Still. Have. Scars.)
- undefuser 3y agoWhat would be a better alternative to Ansible?
- apple4ever 3y agoI'm not sure what you are doing but I have never had these frustrations with Ansible. I absolutely love it. I think it's great for systems you never ssh into and monkey around and just as great for ones you do. Source: been using Ansible for 8 years and SysEng'ing for 15.
- postpawl 3y agoAgreed - Ansible was for a time when people were SSH’ing into boxes and installing stuff and it’s great at that. Jeff still does a lot of that with all his self hosted projects on his home network. Deploying containers and using declarative tools like terraform is much more suitable for keeping cloud infrastructure in sync with your desired state.
- CommitSyn 3y agoThis is the second time I've seen this today. I'm a hobbyist hacker and do small projects. I'm still SSHing into servers to install and configure things. How does it work with cloud infrastructure... Do you not SSH into your server in the cloud and install things? Do you just rely on ready-made scripts to run what you need?
- dharmab 3y agoIt varies a bit, but here are three approaches I've seen. 1. You build custom VM images that have everything you need baked in. You don't upgrade these VMs, instead you build new ones and delete the old ones. 2. You use cluster management tools like Kubernetes or Nomad and run your software as containers. You upgrade by running a new version of the container. (If you choose to manage your own nodes in the cluster, you manage them as VMs using method 1.) 3. You don't run your software on servers you manage. You use so-called "serverless" services where your software doesn't have to think too hard about the OS it's running on.
- postpawl 3y agoRight, and the goal is to be able to easily deploy the same thing. Every time you SSH into a server and install something, you may not be getting the same packages due to updates or packages becoming unavailable. If you’re using an image, most likely you can easily tear stuff down and re-deploy it. Also you’ve got the code used to build the image and can modify it if necessary.
- mercurialuser 3y agoBut you need to create: 1. A Custom vm image, so how do you do it? 2. A container: here is a bit simpler since you may use docer-compose...
- rcarmo 3y agoI mostly use cloud-init these days, to the point where I just went and built a shim (https://github.com/rcarmo/ground-init https://github.com/rcarmo/ground-init) for desktop setups. But if you don’t nuke & pave your infrastructure, Ansible is much better than other desired state configuration tools (Puppet was infamous for locking us out of machines, Salt was full of quirks, PowerShell DSC is… well… just not something I’ve ever liked to use in any way, etc.)
- Havoc 3y agoI’ve found it quite good for a self documenting ssh/bash command delivery system. Most of my homelab is set up that way. Purposefully sticking to shell rather than the specific custom modules. Anything requiring any sort of finesse especially on timing is yeah…rough as you say
- allarm 3y agoWhile I completely agree with everything you’ve said, I guess I spent too much time with Ansible and learned to love it. It’s still love/hate relationship but I know it very well and just accept the bad design as a given. One thing I learned the hard way - sometimes if you have to deal with complex data structures and data manipulation in Ansible it’s better to decouple the logic into a plug-in or a filter, even if it’s possible in theory to get done by Ansible. Also when you know how to efficiently use it, all the inventory tricks, the proper directory and file structure - you can build runbooks that are as close to being elegant as possible with this kind of software.
- fb03 3y agoI wish there was an Ansible thing but built in a real programming language, where we'd get all the type hinting and autocompletions stuff in without much fuss. Basically what Pulumi did for IaC (versus Terraform which is just like Ansible, textual hell) I've thought about building something like this in Rust. Maybe something that compiles a statically linked binary which gets uploaded over the wire, and that is the thing that gets run in the final system to apply your new config state.
- computershit 3y agoAnsible might not be perfect, but, like you, having done this for two decades, I seen some shit with all of Ansible's competitors (the same hate you have for Ansible I have for Chef). The stlib in Ansible is what will keep me using it as long as I have a need to ssh to anything.