Is Ansible Turing Completed?

Ansible offers many filters and conventions. As far as I can judge; It should be possible to implement Ansible playbook, which performs a set of tasks that achieve the same result as the Turing Complete language. So, is Turing completed?

+5
source share
1 answer

I think this is right.

  • Ansible can generate yaml files and run on it (both can be executed as local_action ), which is the rough equivalent of the eval() function.
  • Ansible can create lists and iterate over them. Together with include_role it opens the possibility of running arbitrary complex code in a loop (with conditions).
  • Together with the until keyword, it allows you to create a classic while / until loop.
  • block with a where statement allows branching. Even inside the loops.

In addition, playbook-related plugins are considered a valid way to expand the playlist, so they provide full python functions.

+1
source

Source: https://habr.com/ru/post/1258457/


All Articles