简体   繁体   中英

How to use vagrant provision to configure real server?

I have configured my vagrant virtual machine and I have the Provision profile that contains all necessary configs. Can I move those settings to the real machine? Official docs contain next phrase 'Vagrant - the command line utility for managing the lifecycle of virtual machines', so the vagrant profile is used only for configuring a virtual machine, right? (It can not be used for configuring real computer) If it can, could you describe the way to make it.

It's not possible in Vagrant itself.

You want to provision your host machine and for that I recommend using Ansible and you simply target localhost.

Inside Ansible you can still use shell commands if that's what you have used so far for your provisioning.

I've found an answer that follows this questions: Run command on the Ansible host

Another workaround is to use plugins made by community, such as:

phinze/vagrant-host-shell

emyl/vagrant-triggers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM