Ansible
Last updated: 2 minutes read.
Requirements
- Ansible is required to run the following commands. Instructions on how install Tyk CE with shell is in the Shell tab.
 - Ensure port 
8080is open: this is used in this guide for Gateway traffic (the API traffic to be proxied). 
Getting Started
- clone the tyk-ansible repositry
 
$ git clone https://github.com/TykTechnologies/tyk-ansible
cdinto the directory
$ cd tyk-ansible
- Run initialisation script to initialise environment
 
$ sh scripts/init.sh
- 
Modify
hosts.ymlfile to update ssh variables to your server(s). You can learn more about the hosts file here - 
Run ansible-playbook to install
tyk-ce 
$ ansible-playbook playbook.yaml -t tyk-ce -t redis
You can choose to not install Redis by removing the -t redis. However Redis is a requirment and needs to be installed for the gateway to run.
Supported Distributions
| Distribution | Version | Supported | 
|---|---|---|
| Amazon Linux | 2 | ✅ | 
| CentOS | 8 | ✅ | 
| CentOS | 7 | ✅ | 
| Debian | 10 | ✅ | 
| Debian | 9 | ✅ | 
| RHEL | 8 | ✅ | 
| RHEL | 7 | ✅ | 
| Ubuntu | 21 | ✅ | 
| Ubuntu | 20 | ✅ | 
| Ubuntu | 18 | ✅ | 
| Ubuntu | 16 | ✅ | 
Variables
vars/tyk.yaml
| Variable | Default | Comments | 
|---|---|---|
| secrets.APISecret | 352d20ee67be67f6340b4c0605b044b7 | 
API secret | 
| secrets.AdminSecret | 12345 | 
Admin secret | 
| redis.host | Redis server host if different than the hosts url | |
| redis.port | 6379 | 
Redis server listening port | 
| redis.pass | Redis server password | |
| redis.enableCluster | false | 
Enable if redis is running in cluster mode | 
| redis.storage.database | 0 | 
Redis server database | 
| redis.tls | false | 
Enable if redis connection is secured with SSL | 
| gateway.service.host | Gateway server host if different than the hosts url | |
| gateway.service.port | 8080 | 
Gateway server listening port | 
| gateway.service.proto | http | 
Gateway server protocol | 
| gateway.service.tls | false | 
Set to true to enable SSL connections | 
| gateway.sharding.enabled | false | 
Set to true to enable filtering (sharding) of APIs | 
| gateway.sharding.tags | The tags to use when filtering (sharding) Tyk Gateway nodes. Tags are processed as OR operations. If you include a non-filter tag (e.g. an identifier such as node-id-1, this will become available to your Dashboard analytics) | 
vars/redis.yaml
| Variable | Default | Comments | 
|---|---|---|
| redis_bind_interface | 0.0.0.0 | 
Binding address of Redis | 
Read more about Redis configuration here.