News for hackers. Stuff that matters.
Re:XML Is the Future by andrewflnr on Monday June 26, 2023 @01:37AM (#36476078)
I would phrase almost the same idea from the opposite angle: focus on the fundamentals that never change, and view the trends in terms of how they relate to those fundamentals.

But also, those are some pretty odd comparisons. For sure Ansible and Terraform aren't directly comparable. If anything they're complementary. Terraform provisions machines (and also infra, etc), and Ansible configures provisioned machines.

Re:XML Is the Future by hardwaresofton on Monday June 26, 2023 @01:59AM (#36476215)
> I would phrase almost the same idea from the opposite angle: focus on the fundamentals that never change, and view the trends in terms of how they relate to those fundamentals.

Definitely -- I'd say that these questions force the understanding of the fundamentals, because that's what you get down to ("fundamental"/irreconcilable differences).

The problem is that fundamentals can be similar, and sometimes the difference is elsewhere (UX/DX/perf for example).

> But also, those are some pretty odd comparisons.

So they are odd comparisons, in some sense -- but the point was to reflect the kind of questions someone who didn't know the answer would ask. Ansible and Terraform (and Salt/Puppet/Chef) are often presented in similar context and they're often confusing precisely because they are so close but different.

The other example (CGI vs Serverless) is situation that's somewhat more targeted towards the age discussion -- did we churn over the years for churnings' sake?

> For sure Ansible and Terraform aren't directly comparable. If anything they're complementary. Terraform provisions machines (and also infra, etc), and Ansible configures provisioned machines.

What you've said is the usual rebuttal (and it's mostly right!), but did you know that Ansible did/does provisioning?[0] The lines aren't drawn as neatly as they seem to be.

You can build a Terraform-like experience out of Ansible, if you wanted to, and it's important to know that and why you choose a tool like Terraform instead of traveling deep into Ansible land.

All that said, if you prefer, replace "Ansible" with "Pulumi" (Full Disclosure: I'm firmly on the Pulumi side in the Terraform vs Pulumi debate).

[0]: https://docs.ansible.com/ansible/latest/collections/index_mo...

Re:XML Is the Future by 28304283409234 on Monday June 26, 2023 @03:30AM (#36476776)
A better comparison would perhaps be “ansible” vs “puppet” vs “chef”.

I wrote everything in shell, then puppet, then chef, then ansible. Doing literally the same thing. Because fads.

Re:XML Is the Future by hardwaresofton on Monday June 26, 2023 @04:43AM (#36477273)
Taking this comment in good faith, because HN...

Do you really not see any difference between Ansible and a shell script?

Even just the move between shell and bash/csh/tcsh/zsh whatever else can make a marked difference in productivity and ergonomics.

Re:XML Is the Future by TeMPOraL on Monday June 26, 2023 @05:13AM (#36477469)
> Do you really not see any difference between Ansible and a shell script?

Surely they do, but how much those differences matter depends on where those tools sit in relation to what you're trying to achieve.

For example, I could write essays about the differences between bash and PowerShell, and about differences in productivity their various facets create, in both abstract and concrete terms. However, when my task is not about shell scripting per se, and the script plays only a minor role in the solution ("oh, but we can make the button launch a script that launches X"), and my main concern about that stage is to convince the team to use Bash and/or PWSH instead of making Python a dependency in the project - then bash and PWSH are really the same thing to me - any difference in productivity for that use case is dominated by one's familiarity with the tool, and none of it matters anyway if my co-worker succeeds slotting in Python for that use case.

Similarly, there are many differences between bare shell scripts and Ansible, and there are differences between Ansible and Puppet and Chef too. But they're also close to each other, so if your use case doesn't hinge on those differences, you can be excused for wondering why can't we just keep using a Makefile for this.

Re:XML Is the Future by allarm on Monday June 26, 2023 @05:23AM (#36477529)
I mean, yeah? Ansible has roles, collections and a great inventory system. There's a lot of extra steps if you want to use a shell script instead, to i.e. install Docker on multiple hosts running different OS versions. I don't really like Ansible, but I think it's quite good for provisioning. It's also super easy to write filters and plugins for extra functionality.
Re:XML Is the Future by WesolyKubeczek on Monday June 26, 2023 @10:31AM (#36480084)
I can see that Ansible with its do-it-yourself-AST-in-YAML is more tedious to write and even debug :-P No wonder they have shorthand versions of their module calls, too.

I'm still using it, though every piece of software lately, fad or not, is something I tend to endure or survive or cope with, rather than use or enjoy using. Little papercuts everywhere.

Re:XML Is the Future by 28304283409234 on Tuesday June 27, 2023 @02:31AM (#36489566)
Context: I wrote deploy and configurations in Shell in 1999, for Employer A. I started writing Ansible in 2013, for Employer F.

In the middle I wrote puppet and chef. All doing basically the same stuff. And yes, obviously there's worlds of differences. Using Puppet killed my productivity, for example.

But my point was that those tools are more comparible than 'terraform' vs 'ansible'. I stand by that comment.

Re:XML Is the Future by hardwaresofton on Tuesday June 27, 2023 @03:02AM (#36489752)
thanks for responding -- I do agree that ansible, puppet, and salt are the closer comparisons (they are of the same lineage -- I mentioned them in passing and kind of clumped them together).

See my response here[0] as well, but to summarize:

- There is more overlap than it seems on the surface (not implying that you are taking a surface view)

- I wanted to get across was the way someone might ask if they were new/looked at it all as churn from the outside. The average dev who thinks "devops churns too fast" is not necessarily going to know the difference between ansible and terraform to begin with, never mind knowing that ansible/salt/puppet/chef are a different approach/lineage compared to terraform.

> And yes, obviously there's worlds of differences. Using Puppet killed my productivity, for example.

I never used Puppet -- it was love at first sight with Ansible for me, felt like the perfect amount of abstraction/structure even though some of the patterns were long in the tooth.

My career is not as long as yours, but I still use ansible to this day (with pulumi).

[0]: https://news.ycombinator.com/item?id=36476215

Re:XML Is the Future by sofixa on Monday June 26, 2023 @08:42AM (#36478971)
> What you've said is the usual rebuttal (and it's mostly right!), but did you know that Ansible did/does provisioning?[0] The lines aren't drawn as neatly as they seem to be.

In the same way that a toaster can be used as a hammer if you hit nails hard enough with it from the "correct" side. Ansible barely does it's main purpose, configuration management, but abusing it for provisioning is just on a different level. Even overlooking the extremely narrow feature set, just `state: absent` should be enough to convince anyone Ansible just isn't made for provisioning. Add it the bolted on templating of a configuration language that uses spaces for logic, the fun of Python dependencies of which you need a ton to do any provisioning, and you're just in for a massive world of pain for literally no reason.

Disclaimer: I work at HashiCorp, but not on or with Terraform, and have had a disdain for using YAML for anything other than basic configuration and Ansible for anything other than simple, basic, low complexity and low scale Configuration Management since I inherited an Ansible project to manage VMware configuration in a past job.

Re:XML Is the Future by kitd on Monday June 26, 2023 @02:44AM (#36476496)
Lord, teach me to accept the things I cannot change,

And use version control for the things I can ...

Re:XML Is the Future by coldtea on Monday June 26, 2023 @03:52AM (#36476920)
>Terraform provisions machines (and also infra, etc), and Ansible configures provisioned machines.

Each of such tools expands to take the role of the other (and also read email)...

Re:XML Is the Future by CraigJPerry on Monday June 26, 2023 @04:04AM (#36477011)
Hmmm i feel like those tools naturally railroad you into a certain split of responsibilities.

Sure - you could use tf’s local/remote-exec to do the stuff you’d normally do with ansible but man that would be annoying and slow going when you know you can reach for ansible.

Vice versa, you could have an ansible playbook to call the cloud provider’s api and cook up some kind of approval workflow / state management but man that would be annoying and slow going when you know you can reach for terraform.

Re:XML Is the Future by TeMPOraL on Monday June 26, 2023 @04:28AM (#36477172)
Do they integrate that well? I don't have much experience with either, and until this moment I understood them to be substitutes - but still, I thought that:

> you could have an ansible playbook to call the cloud provider’s api and cook up some kind of approval workflow / state management

Was generally what people did before Terraform, and they be reluctant to add another complex tool, significantly overlapping with the current complex tool, just to simplify a part that already works OK.

Conversely, if Terraform is really so amazing as one would believe reading HN, then some amount of "local/remoe-exec" pain seems justified if it lets you avoid bringing in Ansible with all its complexity?

All these tools cost not just storage and processing, but also brain space. A Makefile in a cron, running some shell scripts, may be more brittle than whatever cookbooks or playbooks or ${what's the name for Terraform's flavor of makefiles}, but is also might be easier to fix when something breaks.

Re:XML Is the Future by xorcist on Monday June 26, 2023 @07:34AM (#36478357)
> Terraform provisions machines (and also infra, etc), and Ansible configures provisioned machines

Ansible can provision virtual machines as well, and from my experience it is better suited for it too, since it doesn't save state outside the system. So there's lesser chance for it to get out of sync.

It's mostly culture. People these days learn GKE or Kubernetes first, and their tutorials mention Terraform so that's what they'll use. It used to be managed VMs and that culture was around Puppet, Ansible or Salt.

Re:XML Is the Future by sofixa on Monday June 26, 2023 @08:43AM (#36478987)
> Ansible can provision virtual machines as well, and from my experience it is better suited for it too, since it doesn't save state outside the system. So there's lesser chance for it to get out of sync.

State serves a purposes, it's not just there for fun. Ansible will lose track of your VM if you rename it (and can barely handle you renaming it with itself), and won't delete it if you just delete it from the configuration file.

Re:XML Is the Future by xorcist on Monday June 26, 2023 @01:32PM (#36482938)
> State serves a purposes, it's not just there for fun

The system has state. The question is how we want to manage it. The design in this case chooses to opimize to lessen the impact of errors. All real world systems are prone to errors in the long run.

If real world parables are excused: If the map (serialized state) and terrain (system state) differs, is it a good idea to insist on following the map?

> Ansible will lose track of your VM if you rename it

Sure, but so will Terraform. Or worse.

> won't delete it if you just delete it from the configuration

Sure it can. There are no limitations there. The only questions are whether you want it to, and how you want it to.

Ansible is a superset of Terraform. It's mostly a matter of culture which tool people choose, and which you think is the easiest to use.

Re:XML Is the Future by sofixa on Monday June 26, 2023 @01:50PM (#36483198)
> If the map (serialized state) and terrain (system state) differs, is it a good idea to insist on following the map?

If you're doing landscaping and the map is your requirements, yes. And that's what infrastructure is comparable to (hence Terraform's name btw)

> > Ansible will lose track of your VM if you rename it

> Sure, but so will Terraform. Or worse.

No it won't, because Terraform stores the underlying platform ID in it's state. It will just know there was a rename, and will inform you it plans on rolling it back to what you have requested in the configuration. It won't delete it. Ansible will want to recreate it, with all conflicts this could bring.

> Ansible is a superset of Terraform. It's mostly a matter of culture which tool people choose, and which you think is the easiest to use.

It's a different tool for a different job (at which it isn't great due to using a markup language which really doesn't lend itself to templating with lots of templating, and a dynamic language that suffers from version and dependency hell).

Re:XML Is the Future by jerf on Monday June 26, 2023 @09:30AM (#36479439)
A great example of the narcissism of small differences [1]. Locally in the space of management tools, terraform and ansible are very different beasts, in that they can hardly even manage the same tasks. Globally, if you plot all software in the world on some big graph, they are right next to each other and indistinguishable on a plot that has "video games" and "databases" and "routing software" and "spacecraft code", etc.

[1]: https://en.wikipedia.org/wiki/Narcissism_of_small_difference...

Re:XML Is the Future by pizzafeelsright on Monday June 26, 2023 @07:18PM (#36487117)
I did a 3x of my career by doing this.

Now everything thing looks like a shell script or json exchange.

Ansible is a bunch of scripts. Terraform is a bunch of json exchanges.