jaugustin / vagrant-ansible-local

Vagrant plugin that provision your VM with ansible playbooks directly from the guest VM
MIT License
65 stars 5 forks source link

Sync folders changing warning using docker #5

Open bpearson opened 6 years ago

bpearson commented 6 years ago

When using docker, vagrant complains about sync folders changing when starting a container that has already been provisioned, I believe it stems from this line: https://github.com/jaugustin/vagrant-ansible-local/blob/641c3ba82aafc5ff162f08ae4049c687ca6bbc68/lib/vagrant-ansible-local/provisioner.rb#L6

What happens is vagrant compares fresh to cached and Pathname.new leaves a little bit at the start (#Pathname: ) which makes the comparison fail. I think one way to fix it would be to wrap File.expand_path around Pathname.new, but not 100% sure.

Steps to replicate...

  1. Create a vagrantfile that uses docker with ansible installed locally.
  2. Create and start the container with vagrant up.
  3. Stop the container with vagrant halt.
  4. Start the container up again with vagrant up and the message appears...

==> test: Vagrant has noticed that the synced folder definitions have changed. ==> test: With Docker, these synced folder changes won't take effect until you ==> test: destroy the container and recreate it.