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?

Karim Tabet
  • 1,789
  • 1
  • 14
  • 35

1 Answers1

8

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.

George Shuklin
  • 6,952
  • 10
  • 39
  • 80