ansible automation to master/slave test
Python Shell
Switch branches/tags
Nothing to show
Clone or download

Swarm for

Ansible AWS Provisioning for Distributed load testing. There will be one Master VM and a number of slave VMs


- Depends on Ansible and boto
	$ sudo pip install ansible
	$ sudo pip install boto
- Ships with and ec2.ini from ansible. you probably want to check [this doc and update](
- Export credentials
	$ export AWS_ACCESS_KEY_ID=<aws access key id>
	$ export AWS_SECRET_ACCESS_KEY=<aws secret access key>
- Disable host key checking 

- At AWS, take note of your VPC id, subnet id, IP block assigned to this subnet and the key name you will be using.
- Each region may have distinct AMI ids for Ubuntu 14.04 64 bits (trusty)
- Configure group_vars/all with your data
- slave_count is the number of slave VMs
- test_host is the target host you will be testing (base host, not full URL)
	ssh_key_name: aws_devel
	aws_region: us-east-1
	ami_id: ami-9eaa1cf6
	instance_type: t2.micro
	vpc_id: vpc-ffffffff
	subnet_id: subnet-ffffffff
	slave_count: 3
		test_host: ""

$ ansible-playbook -i aws_hosts.ini locust.yml --private-key ~/.ssh/aws_devel.pem
- aws_devel.pem is your public key, the same referred in the file above
- aws_hosts.ini file containing

- use EC2 panel to remove servers or $ ansible-playbook -i ./ remove_servers.yml

Testing agent

The testing agent is, copied into templates/ dir of locust role. If you use it will do it for you

Target host

The target host is configured at locust.yml variable test_host


Access the master VM using http://ip:8089