News for hackers. Stuff that matters.
Re:Ansible 2.0 released by gerbilly on Tuesday January 12, 2016 @04:43PM (#10890627)
I think the reason they didn't use a procedural language is because they specifically wanted to keep the playbooks declarative.

Ideally, the playbook should describe the state you want the system to be in.

This is 'almost' the case for most modules and I think this was a very good design decision.

Having said that, the ghastly YAML format was almost a deal-breaker for me too.

Re:Ansible 2.0 released by themckman on Wednesday January 13, 2016 @03:18AM (#10892972)
> ... keep playbooks declarative.

I guess I've never really considered playbooks declarative. They are written like and feel like a script I'd write in a language like, I don't know, Python. Now, Salt state files I would consider declarative. They are simply Jinja templated dictionaries (Ansible is YAML that tries to find values templated with Jinja; BIG difference as I've discovered using Ansible for the last 6 months) that actually describe a set of states the host should be in. Ansible's playbooks encode a set of function calls that should be applied in a particular order. Don't get me wrong, playbooks ARE powerful in their ability to describe processes that span multiple hosts and I recognize that, but I'd really like to use a real programming language rather than some half-baked one that is encoded in YAML.

I agree with the GP that I wish the Python API was a bit more robust. Currently we have several tools that generate playbooks on the fly, write them to temporary files and then run them with ansible-playbook to ensure we don't lose some functionality that makes playbooks as powerful as they are. Now, it appears the API has significantly changed in 2.0 and it looks like they expose (read: recommend using) more of it making it easier to script with Ansible.

Re:Ansible 2.0 released by davexunit on Tuesday January 12, 2016 @04:49PM (#10890677)
Using a real programming language doesn't preclude a declarative programming style.
Re:Ansible 2.0 released by moises_silva on Tuesday January 12, 2016 @05:52PM (#10891034)
No, but using a 'real' programming language doesn't force you to write in a declarative style unless you use something like a pure functional language and before you know it people would start making a mess in their playbooks using the whole power of Python. Ansible is awesome for devops precisely because it restricts what you can do and forces you to try to do things in a consistent declarative (and hence idempotent) style, which is important to devops.

[edit: fix broken english]

Re:Ansible 2.0 released by lenkite on Thursday January 14, 2016 @08:35AM (#10901239)
This could have been solved by choosing a language like lua and restricting the runtime environment - which is what is done in game software. Lua also has a tight, efficient interpreter. Making a mini-programming language in YAML is _coding horror_.
Re:Ansible 2.0 released by Florin_Andrei on Tuesday January 12, 2016 @06:59PM (#10891353)
> the playbook should describe the state you want the system to be in

This is the real reason.

The playbook is the final state. How it gets there is of no interest to you. All you need to be concerned with is the final result - the state described by the playbook. All the extra complexity is handled by the software.

Re:Ansible 2.0 released by davexunit on Tuesday January 12, 2016 @10:15PM (#10892112)
But you can declaratively specify a full system configuration in a real programming language, too. This is precisely what the GNU Guix system configuration API does, for example. You write OS configs in functional, declarative Scheme code.

http://www.gnu.org/software/guix/manual/html_node/System-Con...

Re:Ansible 2.0 released by quicksilver03 on Wednesday January 13, 2016 @05:14AM (#10893350)
Ansible's playbooks aren't declarative for me, I've came to the conclusion that they're a framework to write shell scripts.

Dependencies are expressed by the sequence of the code blocks in the playbooks and roles, and I see them as implicit. In contrast, Puppet makes the dependency tree explicit with the "requires" language construct.

The thing is, Ansible works well enough for 85% of the cases, where the additional complexity that Puppet brings is not needed.