Skip to content

Instantly share code, notes, and snippets.

Created November 22, 2016 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/44eee71f0d07ca824ed01918b6126f84 to your computer and use it in GitHub Desktop.
Save anonymous/44eee71f0d07ca824ed01918b6126f84 to your computer and use it in GitHub Desktop.
#yaml struct
triggers:
halt:
before:
- type: run
command: ssh-config-upsert rm #{machine} #{vars.host_ssh_file}
- type: run_remote
command:
after:
- type: run
command:
- type: run_remote
command:
suspend:
before:
- type: run
command:
- type: run_remote
command:
after:
- type: run
command:
- type: run_remote
command:
destroy:
before:
- type: run
command:
- type: run_remote
command:
after:
- type: run
command:
- type: run_remote
command:
up:
before:
- type: run
command:
- type: run_remote
command:
after:
- type: run
command:
- type: run_remote
command:
halt:
before:
- type: run
command:
- type: run_remote
command:
after:
- type: run
command:
- type: run_remote
command:
# vagrantfile code actual example
config.trigger.before :reload, :vm => [machine_config.name] do
run ssh_config_rm if ssh_config
run_remote "/vagrant/vagrant-triggers/vagrant-before-reload"
end
# I want to loop over the triggers array to automate the feeding of triggers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment