r/linuxadmin • u/Street-Teach489 • Aug 21 '26
Ansible can be a very elaborate way of avoiding SSH
I like Ansible. It’s useful.
But I’ve definitely seen small environments where the playbooks became more complicated than the thing they were originally automating. At some point you’re maintaining roles, variables, inventories and handlers just to make a change that would have taken two commands.
Automation is great when it removes work. It’s less great when you create a new system that needs maintaining instead.
0
Upvotes
37
u/automounter Aug 21 '26
Sounds like you don't ansible enough.
15
u/Vuiz Aug 21 '26
Speed is a by-product of consistency, not necessarily the goal.
20
u/Skuelysten Aug 21 '26
Sounds like you are doing something wrong
14
u/chock-a-block Aug 21 '26 edited Aug 29 '26
Distinct oil rustic coherent acorn thought water wakeful yarn
This post was anonymized with Redact
5
u/jdptechnc Aug 21 '26
Ansible is not a script.
3
u/Dingdongmycatisgone Aug 21 '26
Yes, sometimes manually is better if it's on a very small amount of systems. I manage over 200. I love Ansible lol.
I love the roles, playbooks, nested playbooks, and the integrations. If it's hard for you to manage by itself, try integrating it with other things like GitHub to manage changes, AAP for easier playbook and inventory management, and vscode for easier editing and searching through Ansible files.
If you don't see the value in the automation then maybe you don't manage enough servers for it to be valuable for you.
2
u/stprnn Aug 21 '26
I had the same feeling when I had to use it but I'm also not an admin anymore so...
2
u/EverythingsBroken82 Aug 21 '26
i wish there would be a way to hook ansible calls and outputs totally into a remote log environment. like when i have a certain ansible parameter or conf file, that every output goes immediately to another server. that would be so useful, but you have to build something for this which is brittle and not good maintainable.
2
u/Angelsomething Aug 21 '26
I don’t understand why you’re saying you would have to maintain roles (plural) and inventories if you environment is fairly stable. Fair point on the variables maintenance, but that’s the only thing you’re editing depending on what it that you’re changing.
Two commands on one host should not require the use of ansible, but the same two commands on 20? absolutely.
I don’t know how you’d do infrastructure as code without ansible to be honest.
2
u/Envelope_Torture Aug 21 '26
Of course the playbooks are more complicated. This is like complaining that the factory that pumps out cars is too complicated, and retooling it takes too long when you can just "drill two new holes" in every car that comes off the line.
1
u/stufforstuff Aug 21 '26
Classic case of:
https://xkcd.com/1205/
1
u/Scill77 Aug 22 '26
Sound like you need puppet.
1
u/SeaworthinessHour233 Aug 22 '26
I guess your Ansible code base needs refactoring
1
u/thoriumbr Aug 21 '26
Ansible is not made for automation, that's the side effect. It's for consistency.
When you have a large park of servers, you don't want to have to think on every single configuration change where the backups will be, what will be changed, what are the tests and everything else. You want to run one process and the process gives you all you need.
If you just SSH into the server, it will be less work now, but 6 months down the line you don't know with all certainty what was done, so if you are to execute the same change, you may do different things.
With Ansible you write a playbook, run it, and it will always do the same thing. You will have to keep the servers in a consistent state, use image templates, and don't do things by hand anymore, and that increases the consistency of the entire infrastructure.
1
u/Hotshot55 Aug 21 '26
Does it really avoid ssh when it is using ssh by default?
12
u/_N0K0 Aug 21 '26
You are completely ignoring that by running two commands you have no change log or understanding of what the intended state might be. What if those two commands in turn conflict with a playbook somewhere else? Kill your pets and assume ssh access leads to undue drift