Sure.
Vagrant.configure("2") do |config|
config.vm.provision "shell", run: "always", inline: "service nginx restart"end
On Tue, Sep 12, 2017 at 11:07 AM, James Newton <[email protected]>
wrote:
> Hello Vagrant experts!
>
> In this thread
> <https://groups.google.com/forum/#!topic/vagrant-up/XVFPIOXU8aI> I asked
> how to copy the nginx folder out to Vagrant project folder, so that I can
> edit the server block definitions from the comfort of the host machine.
>
> It turns out that, if I do this, when I run `vagrant up`, nginx starts,
> but fails to initialize the sites (presumably because the contents of the
> nginx folder is changed by Vagrant after nginx has loaded). The short term
> solution is to run...
>
> vagrant ssh
>> sudo service nginx restart
>
>
> ... after `vagrant up`.
>
> My question is: Is there a way to automate this restart of nginx?
>
> Can this be done through an entry in the Vagrantfile? Or would it be
> cleaner to set up a script that will run automatically on the guest server,
> and if so what would this script be and how would it be run?
>
> Thanks in advance for all your enlightenment,
>
> James
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/vagrant-up/984f1523-3327-4ec4-b8cc-8ebb5a220ce3%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/984f1523-3327-4ec4-b8cc-8ebb5a220ce3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Alvaro
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/CAHqq0eyS450mRe9rJcfum1a3tpkC3_UkHX_KqrY-%2BcDzaVBDjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.