How does Vagrant differ from Ansible and Docker? I understand that Ansible is a Configuration Management (CM) tool for orchestrating, deploying (and continuously upgrading) software and conf via a special YAML format created for that software, and that Ansible actions can be done on the local machine via a locally executed Ansible playbook, or remotely for 1 or more machines by listing IP addresses for an Ansible playbook in an Ansible storage file and executing both the storage and associated playbook (without needing to install Ansible on the one or more remote machines).

I also understand that Operating-System-Level-Virtualization ("Containerization") software like Docker (also utilizing YAML in a unique format) allows us to "copy away" containers of "frozen; just-bake" data, from one machine to 1 or more other machines to have a pre-processed data to work with and to change minorally per specific nneds to save time of repeatitive creation of that data in the container time and again.

Sometimes when I read about either Ansible or Docker I come across mentions of Vagrant which is another software.

I understand Vagrant to be a what I can call "All-Level-Virtualization" (operating-system and possibly also some stack above it), yet I'm not sure if that's correct.

How does Vagrant is different than these two in principle (and also the term "Vagrant box" makes me to wonder if Vagrant is an actual "competitor" for Docker, is it?)
Vagrant can complement Ansible and Docker. It is used to spin virtual machines inside which you install Docker and test your Ansible playbooks. You describe desired VM configuration with Vagrantfile and then spawn them with vagrant up command. Then Vagrant software downloads one of shared boxes (VM templates, like bare ubuntu or centos, or with preinstalled software like laravel), and provisions it (executes setup instructions). There are several provisioners, like simple shell, or Ansible.

One of possible scenarios: you want to test mysql:5.7.24 image inside Docker 18.06.1-ce on Ubuntu 18.04. So you:


Spin up ubuntu/bionic64 box with Vagrant
Provision it with Ansible playbook that installs Docker 18.06.1-ce
Start Docker container based on mysql:5.7.24 image