--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/416eb13e-c41c-40cc-97f2-cfadd64eb1f1%40googlegroups.com.
Hey Steve -
On Tue, Feb 11, 2020 at 8:10 AM Steve Freeman <free...@gmail.com> wrote:I have a shell provisioners specified with names, like so:config.vm.provision "disk", type: "shell", path: "provision.ps1"How do I get a trigger to execute specific code only before this particular provisioner?What kind of trigger are you writing? If it's just a trigger that runs on the guest, the easiest thing to dowould be to use a regular provisioner instead.
--
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 vagra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/416eb13e-c41c-40cc-97f2-cfadd64eb1f1%40googlegroups.com.
--Brian Cain
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CADHESCXvz%3Dx7vcccJgKxciCQL43TTzDeWv1ztj0VEQ5wKG3G%2BQ%40mail.gmail.com.
I'm trying to write out a configuration file based on the state of execution at that point in the overall provisioning process. If I don't use a trigger, then the code will execute the code to write the file with different parameters while the Vagrantfile is being evaluated. The resulting file is the last one generated. The file isn't just a handful of properties to be written or I'd pass the values as arguments and write the file locally in the provisioning script.Here is what I'd like to be able to do:config.trigger.before [:up,:provision], :provisioner_name => "install" do |trigger|
trigger.info = "Generate install configuration"
trigger.ruby do |env, machine|
puts "generating configuration for #{json['version'][0]}"
generate_configuration( json, baseOS, node_name )
end
end
config.trigger.before :provisioner_run, type: :hook do |t|
t.info = "Before the provision!"
t.ruby do |env,machine|
puts "ruby stuff!"
generate_stuff()
end
endTo unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/446d83dc-2dbf-4bc8-8fcc-0a5fc2f711ed%40googlegroups.com.
Okay, but how do I obtain the provisioner's name so I can conditionally execute the code?
On Tuesday, February 11, 2020 at 3:48:23 PM UTC-5, Brian Cain wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/446d83dc-2dbf-4bc8-8fcc-0a5fc2f711ed%40googlegroups.com.
--Brian Cain
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/69a43bfd-54c5-4c1c-bb15-04fea1fc2edb%40googlegroups.com.