vagrant resume runs Ansible provider most unexpectedly

15 views
Skip to first unread message

la...@magenta-aps.dk

unread,
Jun 12, 2017, 4:25:42 AM6/12/17
to Vagrant
I just suspended an instance that I had created using an Ansible playbook.

My Vagrantfile:
Vagrant.configure(2) do |config|
  config.vm.box = "hashicorp/precise64"
config.vm.network "private_network", ip: "192.168.33.15"
  vagrant_root = File.dirname(__FILE__)
  ENV['ANSIBLE_ROLES_PATH'] = "#{vagrant_root}/ansible/roles"

  config.vm.provision :ansible do |ansible|
    ansible.playbook = "ansible/playbooks/pbook.yml"
    ansible.verbose = "vvvv"
  end
end

When I did vagrant resume, MUCH to my surprise and annoyance, Vagrant/Ansible reprovisioned the instance, blowing away a lot of work.

I was under the firm assumption, that vagrant resume would NEVER rerun a provisioner, unless explicitly asked.

Why did this happen, and how can I prevent it from happening again?

/Lasse

la...@magenta-aps.dk

unread,
Jun 12, 2017, 5:16:05 AM6/12/17
to Vagrant

Meanwhile, more thorough googling revealed https://github.com/mitchellh/vagrant/issues/6787
The issue is closed, so I hope the bug is fixed in newer versions, however ubuntu seems to continue to install version 1.8.1+dfsg-1 with apt-get, so I guess there are many who might still be bitten by this by accident. I would suggest a mention in the docs that some versions have a potentially destructive behaviour on vagrant resume!

/Lasse

Alvaro Miranda Aguilera

unread,
Jun 12, 2017, 9:17:31 AM6/12/17
to vagra...@googlegroups.com
Hello
The issue you reference was fixed on 

1.8.3 (June 10, 2016)


So you can install the version available on the vagrant website to be up to date
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 vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/be8191fd-1ce2-46b6-a30c-8b8e9ff9a184%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages