Matt Komarnicki
Matt Komarnicki

Reputation: 5422

My Vagrant box forgets about the modifications I've done via vagrant ssh…

I have a Vagrant box that works fine after vagrant up, however there was a small bug in the configuration within the box for one of the sites.

I had to ssh into the box and edit a file. Which I did:

1) I vssh'ed (this is my alias) to the box

2) I opened a file:

sudo vim /etc/nginx/sites-enabled/foo.bar.local.conf

3) I pressed i to start editing specific part of the file

4) I pressed ESC to finish editing

5) I typed :wq to save my changes and exit vim.

6) I restarted nginx to see my changes.

sudo service nginx restart

Everything worked well but after a day or two (when I had to vagrant halt && vagrant up) the original issue reappeared. Then I realised I've forgotten about booting VM with --provision so it will read the change I made.

Apparently calling vagrant up --provision didn't work. I had to edit the conf file again. What am I missing to permanently store my changes?

Upvotes: 1

Views: 78

Answers (1)

Scriptonomy
Scriptonomy

Reputation: 4055

It seems to me, as if you have a script in your Vagrant configuration that is copying locally stored config files to the sites-enabled directory on the VM. If that's the case then edit those files instead.

--provision will not help in this case. --provision simply runs the provision code in Vagrantfile.

Upvotes: 1

Related Questions