![]() Here we install git and python3-pip with apt. The 4th line is really important: those are the missing apps we miss on the VM.The 3rd line defines the official Vagrant image we’ll use for the virtual machine.The first loop of the file, defining what kind of Vagrant configuration file you’re using (here #1).The 1st line defines what versions of Vagrant should execute your Vagrantfile.Here is mine: Vagrant.require_version ">= 2.0.0"Ĭonfig.vm.provision "shell", inline: "apt install -yes git python3-pip"Ĭonfig.vm.provision "ansible" do |ansible|Īnsible.vault_password_file = "vault_password_file"ĭebian, the best OS to operate your online services Install it with the following command: # apt install vagrantĮverything about Vagrant lies in the file Vagrantfile. ![]() Why Vagrant? Because it’s a kind of middleware between your development environment and your virtual machine, allowing programmatically reproducible operations and easy linking your deployments and the virtual machine. If you use the Debian distribution, this link describes how to install it, either from the Debian repositories either from the upstream. If no error remains, tag the version of your Ansible Playbook and you’re ready to deploy in productionįirst, you need Virtualbox.Otherwise destroy the VM, recreate it and deploy to test a last time with a fresh install Fix the issues either from the playbook either from the application deployed by Ansible itself.Launch a fresh virtual machine (VM) and deploy the playbook on this VM using Vagrant.There might exist better solutions and I’m only describing one solution of testing Ansible Playbooks I find both easy and efficient for my own use cases. This allows getting quickly the result of a new modification, iterating and fixing as fast as possible.ĭisclaimer: I am not a profesionnal programmer. Instead of deploying on a remote server, I’ll deploy my Playbooks on a VirtualBox using Vagrant. ![]() I need a simple and a fast way to test the deployments of my Ansible Playbooks locally on my laptop, especially at the beginning of writing a new Playbook, because deploying directly on the production server is both reeeeally slow… and risky for my services in production. I’ll describe in this blog post my setup in order to test my Ansible Playbooks locally on my laptop. I use Ansible to automate the deployments of my websites (, Journal du hacker) and my applications ( Feed2toot, Feed2tweet). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |