Closed dixhuit closed 9 years ago
Are you using Gas Mask at all? I've had trouble with that taking a few minutes to update the hosts file. Just a thought :)
I'm not using Gas Mask. I have experienced delays in the hosts file being updated before but this just seemed too long. To be fair, I haven't tested to see if this is indeed the result of a delay (just a very long one) or whether the entry is never added to the hosts file. I'll set up a wonky experiment to hopefully answer that.
Very strange. What does your ansible.log file say? The step to write to the hosts file is done in the trigger right at the start of the whole run-through, but it's all written to the log. (if it isn't then that will be another bug :P)
Did a wonky experiment and grabbed the Ansible log each time - not attached as GitHub only likes image attachments :(
Nutshell version: the vagrant trigger only runs on the second vagrant up
. So the hosts file edit only happens after the first run. Subsequent halt/up commands later and it seems to work every time.
I was running a slightly older version of vagrant-triggers (0.4.1) and updating that to the latest (0.4.2) doesn't seem to make any difference. I'm running Ansible 1.7.2 (via Homebrew) and Vagrant 1.6.5.
I think you've hit the nail on the head there. Some of the 'up' triggers will only run if the hosts.ini file is in place. I think that's what is going on here. The hosts.ini file isn't present and so the trigger isn't firing.
Right. I can see that the host.ini file is created in local_up.yml but I don't get why that playbook isn't running the first time. Any clue?
Just tried it and I saw no problem. I was also running vagrant-triggers (0.4.1). Strange... Do you have anything else messing with your hosts file? Or perhaps something that is interfering with triggers? Some other version checks:
Do you have anything else messing with your hosts file? Or perhaps something that is interfering with triggers?
Not that I'm aware of. At least I have a kind-of solution for the meantime. Let's leave this issue open and see if anyone else reports anything similar - maybe then we'll be able to get a bit closer to tracking down the real cause.
Is this still an issue Dan? Looking to close if it isn't :)
I do still experience sometimes and am still trying to get to the bottom of exactly what the issue is. Let's leave open for now.
I have found this issue every now and then, but only when I get the password incorrect on the first trigger.
I'm starting to confuse this with another issue I've experienced where ssh-add
is never run due to the host.ini file not being properly removed on vagrant halt
.
Let's close this issue for a clean slate and I'll keep a closer eye on things and create new issues if need be.
Steps to reproduce on both of my systems:
vagrant up
test | default host is setup
vagrant halt
vagrant up --provision
We've discussed this particular failed test before - perhaps this issue is the real cause?
I'm wondering what it is about the second attempt to provision that allows the hosts file to finally be edited as required.