Is there a way to get Vagrant to display the output of the provisioning tool as it runs, rather than just at the end? I'm using the Ansible plugin if that matters.
Vagrant appears to run the entire config.vm.provision
section collecting the output, only displaying it once everything has completed.
This causes problems such as when a step in the process hangs or when you want to have interactive steps that involve the user.
Command: vagrant provision [vm-name]Runs any configured provisioners against the running Vagrant managed machine. This command is a great way to quickly test any provisioners, and is especially useful for incremental development of shell scripts, Chef cookbooks, or Puppet modules.
On the first vagrant up that creates the environment, provisioning is run. If the environment was already created and the up is just resuming a machine or booting it up, they will not run unless the --provision flag is explicitly provided. When vagrant provision is used on a running environment.
The provision line configures Vagrant to use the shell provisioner to set up the machine with the bootstrap.sh file. The file path is relative to the location of the project root which should be the location of the Vagrantfile.
You may want to change vagrant logging level to debug so as to see more output when it does the provision => VAGRANT_LOG=debug vagrant up --provision
This works for Chef Solo (I haven't tried Vagrant with Ansible), the output for the provisioning part is similar to running chef-solo with debug (-l debug
) log level.
For Ansible provisioner, the following been added since vagrant 1.3.2:
See pull request 2153 for details, looks like the official doc has NOT been updated yet.
I think you should be able to add ansible.verbosity
in the Vagrantfile to enable maximum verbosity level
Vagrant.configure("2") do |config|
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
ansible.verbose = "true"
ansible.verbosity = "-vvv"
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With