File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/vagrant.cpython-310.pyc
Back
o ;jo- � @ s~ d Z ddlZddlZddlmZmZ dZdd� Zddd�Z d d � Z dd� Zd d� Zdd� Z dd� Zdd� Zdd� Zdd� ZdS )a� Manage Vagrant VMs ================== Manange execution of Vagrant virtual machines on Salt minions. Vagrant_ is a tool for building and managing virtual machine environments. It can use various providers, such as VirtualBox_, Docker_, or VMware_, to run its VMs. Vagrant provides some of the functionality of a light-weight hypervisor. The combination of Salt modules, Vagrant running on the host, and a virtual machine provider, gives hypervisor-like functionality for developers who use Vagrant to quickly define their virtual environments. .. _Vagrant: http://www.vagrantup.com/ .. _VirtualBox: https://www.virtualbox.org/ .. _Docker: https://www.docker.io/ .. _VMWare: https://www.vmware.com/ .. versionadded:: 2018.3.0 The configuration of each virtual machine is defined in a file named ``Vagrantfile`` which must exist on the VM host machine. The essential parameters which must be defined to start a Vagrant VM are the directory where the ``Vagrantfile`` is located \(argument ``cwd:``\), and the username which will own the ``Vagrant box`` created for the VM \( argument ``vagrant_runas:``\). A single ``Vagrantfile`` may define one or more virtual machines. Use the ``machine`` argument to chose among them. The default (blank) value will select the ``primary`` (or only) machine in the Vagrantfile. \[NOTE:\] Each virtual machine host must have the following: - a working salt-minion - a Salt sdb database configured for ``vagrant_sdb_data``. - Vagrant installed and the ``vagrant`` command working - a suitable VM provider .. code-block:: yaml # EXAMPLE: # file /etc/salt/minion.d/vagrant_sdb.conf on the host computer # -- this sdb database is required by the Vagrant module -- vagrant_sdb_data: # The sdb database must have this name. driver: sqlite3 # Let's use SQLite to store the data ... database: /var/cache/salt/vagrant.sqlite # ... in this file ... table: sdb # ... using this table name. create_table: True # if not present � N)�CommandExecutionError�SaltInvocationErrorZvagrantc C s dt v rtS dS )z< Only if vagrant module is available. :return: zvagrant.version)Fz"vagrant module could not be loaded)�__salt__�__virtualname__� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/vagrant.py�__virtual__<