I worked around this issue by wrapping my "never" provisioners in a
condition that checks that --provision-with is present. In my Vagrantfile:
config.vm.provision "main", type: :ansible do |ansible|
ansible.playbook = "site.yml"
end
if ARGV.include? '--provision-with'
config.vm.provision "update", type: :ansible do |ansible|
ansible.playbook = "update.yml"
end
end
This seems to work for me.
El viernes, 19 de junio de 2015, 11:16:16 (UTC-3), Dharmesh Sheta escribió:
>
> It is possible to run
>
> vagrant provision --no-provision (for not running any provisioner)
>
> vagrant provision --provision-with X (running specfic provisioner)
>
> It is also possible to run some provisioner as "always"
>
> config.vm.provision "shell", run: "always" in the Vagrantfile.
>
> Is it possible to run config.vm.provision "shell", run: "never" and make
> it only possible if vagrant provision --provision-with X is used?
> In other word, is it possible to run specific provisioner only if called
> using "vagrant provision --provision-with X" in any other case including
> vagrant up, vagrant reload it should run(not even once) ?
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/ae6b698b-656c-446c-ad65-b982d713df99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.