Starting the controller via Ansible

You can fetch release, distribute and start the cluster using Ansible Galaxy scripts; setup, test, shutdown

First, get the scripts:

ansible-galaxy install hyperfoil.hyperfoil_setup,0.7
ansible-galaxy install hyperfoil.hyperfoil_shutdown,0.7
ansible-galaxy install hyperfoil.hyperfoil_test,0.7

Now, edit your hosts file, it could look like this:

controller ansible_host=localhost

agent-1 ansible_host=localhost

(You can add more agents by duplicating the last line with agent-2 etc.)

Prepare your playbook; here is a short example that starts the controller, uploads and starts simple benchmark (the templating engine replaces the agents in benchmark script based on Ansible hosts) and waits for its completion. When it confirms number of requests executed it stops the controller.

- hosts: [ hyperfoil-agent, hyperfoil-controller ]
  tasks: [] # This will only gather facts about all nodes
- hosts: hyperfoil-controller
  - hyperfoil.hyperfoil_setup
- hosts:
  connection: local
  - hyperfoil.hyperfoil_test
    test_name: example
# Note that due to the way Ansible lookups work this will work only if hyperfoil-controller == localhost
- hosts:
  connection: local
  - name: Find number of requests
      test_requests: "{{ lookup('csvfile', 'example file=/tmp/hyperfoil/workspace/run/' + test_runid + '/stats/total.csv col=2 delimiter=,')}}"
  - name: Print number of requests
      msg: "Executed {{ test_requests }} requests."
- hosts:
  - hyperfoil-controller
  - hyperfoil.hyperfoil_shutdown

Finally, run the playbook:

ansible-playbook -i hosts example.yml