Ansible installation method doesn't configure redis!

I have just installed tyk using ansible approach, but I wonder why redis is not configured well.


gives this response:

{“status”:“fail”,“version”:“v4.0.0”,“description”:“Tyk GW”,“details”:{“dashboard”:{“status”:“fail”,“output”:“dashboard is down? Heartbeat is failing”,“componentType”:“system”,“time”:“2023-08-18T17:32:20Z”},“redis”:{“status”:“fail”,“output”:“storage: Redis is either down or was not configured”,“componentType”:“datastore”,“time”:“2023-08-18T17:32:20Z”}}}

Hi @rodgers,

Welcome to the community :tada:, and thank you for your patience :scientist:

Please can you provide more information.
What command did you run?
$ ansible-playbook playbook.yaml -t <??> -t <??>

What was the output when you executed the command?

Are you able to get and share the Gateway logs? It should mention some detail about why its not able to connect to Redis.

I figured it out. Thanks

Great work @rodgers. Could you share what the cause was and how you went about solving it?

It would be helpful to community users in future.

Sure. I have set up a CI pipeline in which everything starts off from a git push to a Github Repo. I want to have my TYK gateway deployed on Google Cloud, in a Compute Engine instance. I use Terraform to provision everything I need in Google Cloud, and Ansible to install and configure my TYK gateway.

On a git push to a specified branch, Github Actions workflow is triggered, which in turn triggers Terraform to provision a GCE instance, after which Ansible is trigered to install TYK on the newly provisioned VM.

The reason Redis was not working is because I had at first successfully installed TYK on the VM using the Docker method of installation, which I had done manually by logging into the VM by ssh, as I had not yet introduced Ansible into the whole pipeline. The Redis host I was using previously was a docker network, so the value of Redis host was the name of the docker network I had configured.
When I introduced Ansible, I wanted to automate the process of installing TYK and deplete the previous (Docker) method. What then happened, Ansible’s automated installation failed to update the existing TYK configuration specifically on the part of the Redis host. I had even deleted the docker network since I no longer needed it, but the TYK config file on my Compute Engine instance remained with the network name as the Redis host.

To fix it, I again logged in to my VM by ssh and ran the commands to locate TYK installation’s environment variables, so I looked at what each ENV variable was set to. That’s how I found out that the Redis host was still set to the name of the docker network which I had already deleted. I manually updated the config.