Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Ansible Turing Complete?

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?

like image 675
Karim Tabet Avatar asked Oct 19 '16 09:10

Karim Tabet


People also ask

Is AGDA turing complete?

Languages like Agda, and Charity are not turing complete. However, they are still useful languages because they are able to simulate any provably terminating Turing machine.

What is turing complete programming language?

Practically, what you need to know is that a Turing-complete language (also called a universal language) is one where you can compute anything that any other computational method can compute. In other words, a language that's non-universal—or Turing incomplete—has some limits on the set of things that it can compute.

What is an Ansible playbook?

Ansible Playbooks are lists of tasks that automatically execute against hosts. Groups of hosts form your Ansible inventory. Each module within an Ansible Playbook performs a specific task. Each module contains metadata that determines when and where a task is executed, as well as which user executes it.

Where can I learn more about Ansible?

You can learn more at AnsibleFest, the annual event for all Ansible contributors, users, and customers hosted by Red Hat. AnsibleFest is the place to connect with others, learn new skills, and find a new friend to automate with. Ansible manages machines in an agent-less manner.

Is assembly programming language Turing complete?

It's as Turing Complete as any other programming language. In fact, it was not uncommon for programs to be converted to assembly language as part of the compilation process. So no programming language can do anything that assembly language can't. If C is Turing Complete, so is assembly.

What is Ansible used for in software testing?

About Ansible Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s main goals are simplicity and ease-of-use.

What is a Turing-complete system?

A computational system that can compute every Turing- computable function is called Turing-complete (or Turing-powerful). Alternatively, such a system is one that can simulate a universal Turing machine.


1 Answers

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.

like image 131
George Shuklin Avatar answered Oct 13 '22 16:10

George Shuklin