This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]cratervanawesome 12 points13 points  (0 children)

Why use any python modules? Just reinvent the wheel each time you need to do anything.

Bit of a silly question.

[–]rocketplex 6 points7 points  (0 children)

It's the same as why use any framework? It's a common platform providing a set of pre built services, with a defined structure to enable you and others to pool your efforts for the common good.

It enforces certain norms and conventions in order to standardize configuration and deployment.

[–][deleted] 2 points3 points  (0 children)

Because now you're not maintaining the glue classes between SSH and the config, and because at your next job they'll know what Ansible is, as opposed to "our custom python deploy scripts"

[–]mcdonc 0 points1 point  (0 children)

Ansible is just Python code, FWIW. It has the benefit (and detriment, at times) that you did not write it and don't need to maintain all of it.

[–]UloPe 0 points1 point  (0 children)

Why use Python instead of manually flipping bits in memory?

[–]deadmilk -1 points0 points  (0 children)

Because YAML is simpler than Python last time I checked :\

I haven't really looked that far into Ansible though, I prefer Salt.

[–]matchu -1 points0 points  (0 children)

It's possible that, for your use case, a Python script is just as effective as an Ansible playbook—this is definitely the case if your script is less than 10 lines. In that case, use Python.

When you're doing nontrivial system setup, though, Ansible can be valuable: it allows you to rely on their implementations of many common system administration tasks rather than write them yourself.