Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Ansible role to install Go Replay tool

License

Notifications You must be signed in to change notification settings

bigpandaio/goreplay-role

 
 

Repository files navigation

Logo

CircleCI

GoReplay Ansible role

This ansible role installs and configure GoReplay.

Getting Started

These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install the GoReplay utility as a service in your Debian system.

Prerequisities

Ansible 2.4.0.0 version installed. Inventory destination should be a Debian environment.

For testing purposes, Molecule with Vagrant as driver (with landrush plugin) and VirtualBox as provider.

Installing

Create or add to your roles dependency file (e.g requirements.yml):

- src: idealista.goreplay_role
  version: 1.0.0
  name: goreplay

Install the role with ansible-galaxy command:

ansible-galaxy install -p roles -r requirements.yml -f

Use in a playbook:

---
- hosts: someserver
  roles:
    - { role: goreplay,
        goreplay_input: '--input-raw :80',
        goreplay_output: '--output-http=http://test01:80',
        goreplay_service_enabled: yes
      }

Usage

To enable GoReplay and replicate traffic on another host

goreplay_input: --input-raw :80
goreplay_output: --output-http=http://test01:80
goreplay_service_enabled: yes

To save it to a file

goreplay_input: --input-raw :80
goreplay_output: "--output-file={{ goreplay_output_dir }}/requests.gor"
goreplay_service_enabled: yes

!Stop GoReplay to retrieve the file, otherwise you could lost last requests https://github.com/buger/gor/wiki/Saving-and-Replaying-from-file#buffered-file-output

goreplay_service_state: stopped

Or stop the service manually

ssh user@host
sudo service goreplay stop

Or start the service with a low flush interval

goreplay_input: --input-raw :80
goreplay_output: "--output-file={{ goreplay_output_dir }}/requests.gor"
goreplay_service_enabled: yes
goreplay_options:
  - output-file-flush-interval 0m1s

Testing

molecule test

Built With

Ansible

Versioning

For the versions available, see the tags on this repository.

Additionaly you can see what change in each version in the CHANGELOG.md file.

Authors

See also the list of contributors who participated in this project.

License

Apache 2.0 License

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Acknowledgments

About

Ansible role to install Go Replay tool

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%