Run ansible playbook after provisioning multiple machines

23 views
Skip to first unread message

joel.van...@gmail.com

unread,
Mar 3, 2019, 4:23:27 PM3/3/19
to Vagrant
Hello,

I'm currently at a loss as to how to get this done and I hope someone can help me out; I have two machines defined in a Vagrantfile. Each of the machines are spun up and run their ansible provisioning file. Both are MySQL database servers and I'm trying to setup replication (master/master) between them. This requires that both machines are running and have MySQL installed. I have made an Ansible script that gets the binlog files and positions on both machines and sets up replication but I can't get vagrant to run this script after the two hosts have been spun up. Does anyone have an idea how to solve this?

Brian Cain

unread,
Mar 4, 2019, 12:33:57 PM3/4/19
to vagra...@googlegroups.com
Hey there,

You might be able to use the Vagrant trigger feature for running commands/scripts after a guest has been set up and provisioned:


On Sun, Mar 3, 2019 at 1:23 PM <joel.van...@gmail.com> wrote:
Hello,

I'm currently at a loss as to how to get this done and I hope someone can help me out; I have two machines defined in a Vagrantfile. Each of the machines are spun up and run their ansible provisioning file. Both are MySQL database servers and I'm trying to setup replication (master/master) between them. This requires that both machines are running and have MySQL installed. I have made an Ansible script that gets the binlog files and positions on both machines and sets up replication but I can't get vagrant to run this script after the two hosts have been spun up. Does anyone have an idea how to solve this?

--
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/9231515f-4167-4874-83c8-c64b935d57d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Brian Cain
Reply all
Reply to author
Forward
0 new messages