Skip to content

Instantly share code, notes, and snippets.

@jeanpaulazara
Last active March 1, 2017 00:12
Show Gist options
  • Save jeanpaulazara/ea39c9c53cbee2ac65989dd8a650997c to your computer and use it in GitHub Desktop.
Save jeanpaulazara/ea39c9c53cbee2ac65989dd8a650997c to your computer and use it in GitHub Desktop.
Testing provision scripts w/o restarting vagrant

We spin up a Cassandra cluster. It takes 12 to fifteen minutes to run vagrant up. Sometimes we want to test a new playbook or bash script without taking the instances down.

First step is to get Vagrant to rsync our project directory.

vagrant rsync

$ vagrant rsync
==> node0: Rsyncing folder: /Users/jean/github/cassandra-image/ => /vagrant
==> node1: Rsyncing folder: /Users/jean/github/cassandra-image/ => /vagrant
==> node2: Rsyncing folder: /Users/jean/github/cassandra-image/ => /vagrant
==> bastion: Rsyncing folder: /Users/jean/github/cassandra-image/ => /vagrant

Copy files

ansible nodes  -m copy -a "src=/etc/hosts dest=/tmp/hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment