11

Ansible offers many filters and conditionals. As far as I can tell; it should be possible to implement an Ansible playbook that executes a set of tasks that achieve the same outcome as a Turing Complete language. So, is it Turing Complete?

0

1 Answer 1

9

I think it is.

  1. Ansible can generate yaml files and run itself upon it (both may be done as local_action), which is a rough equivalent of eval() function.
  2. Ansible can create lists and iterate over them. Together with include_role it opens ability to run arbitrary complex code within loop (with conditions).
  3. Together with until keyword it allows to create classic while/until loop.
  4. block with where statement allows branching. Even within loops.

Moreover, playbook-related plugins are counted as a valid way to extend playbook, therefore they provide full python features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.