i have new Vagrantfile (generated with init command) with next first lines:
# -*- mode: ruby -*-
# vi: set ft=ruby :
so, the question is in title, it is possible to write/rewrite vagrant default config file in python? and how it must be look?
No, it's not possible to write Vagrant config files in Python. The native language for Vagrant is Ruby, and that's the language the config files are written in.
The Vagrant docs explain this and point out that it's usually not a problem if you don't know Ruby:
The syntax of Vagrantfiles is Ruby, but knowledge of the Ruby programming language is not necessary to make modifications to the Vagrantfile, since it is mostly simple variable assignment. In fact, Ruby isn't even the most popular community Vagrant is used within, which should help show you that despite not having Ruby knowledge, people are very successful with Vagrant.
If you are looking to use Python for the provisioning step, you could use the Shell provisioner and write your scripts in Python.
There are also some projects that can help use Vagrant in a Python-focused environment. For example: todddeluca/python-vagrant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With