Installation Error

I´m trying to install a test installation for Ubuntu with the tutorial in the docs section.
However, I get an installation error at this step:

root@alxtyk01:~/tyk-ansible# ansible-playbook playbook.yaml -t tyk-pro -t redis -t mongodb

ERROR! the role 'community.mongodb.mongodb_repository' was not found in /root/tyk-ansible/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/root/tyk-ansible

The error appears to be in '/root/tyk-ansible/playbook.yaml': line 20, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- community.mongodb.mongodb_repository
  ^ here

Any suggestions?


Hello @Philipp

Did you run the following command sh scripts/

The runs ansible-galaxy install -r requirements.yaml which in turns installs the community.mongodb collection.


I did it twice with 2 freshly installed vms, in case I forgot something.
but I´m always getting the same error.

the script is running successfully, however.

Hello @Philipp,

Can you please run the following command and show me the results?

ansible-galaxy collection list

Also, what version of ansible are you using?


Well, I´m using the link provided in the docs for installing ansible:

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

according to apt-show-versions: ansible:all/focal 2.9.6+dfsg-1

The command you asked for is not really working:

al_admin@alxtyk01:~$ ansible-galaxy collection list
usage: ansible-galaxy collection [-h] COLLECTION_ACTION …
ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: ‘list’ (choose from ‘init’, ‘build’, ‘publish’, ‘install’)

Hello @Philipp,

I am now able to recreate the problem. It seems to be a versioning issue on Ubuntu Focal. I will investigate and get back to you.


Alright, so the issue spawned from installing ansible using the apt-get the latest version of ansible can be installed using pip3.

Please follow these instructions to get ansible collections working:
sudo apt remove ansible
sudo apt install python3-pip (if you don’t have pip3 installed)
pip3 install ansible
export PATH=$PATH:~/.local/bin (if you can’t execute ansible from the cmd line)
ansible --version (this should give you the 2.10 version now)

Once you have ansible set up you’ll need to rerun the to install the collection and everything should work from there on.

Please let me know if you run into any other issues.

Thanks, this is working now, but now I´m already stuck at the next step. And this is more a lack of my tiny linux knowledge, rather than a tyk installation error, as I don´t know how to properly format the hosts.yaml,

root@alxtyk01:/home/al_admin/tyk-ansible# ansible-playbook playbook.yaml -t tyk-pro -t redis -t mongodb

PLAY [redis] *******************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************
fatal: [redis]: FAILED! => {"msg": "Missing sudo password"}

PLAY RECAP *********************************************************************************************************************************************************
redis                      : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


I added the ansible_password and ansible_sudo_password variables to the hosts.yaml, but getting the “Missing sudo password”.
Tomorrow morning, I will start a cloud trial because we need to get things started for our webshop project. After that, maybe I have the time to deal with the on-premise installation again. :smiley:

@Philipp I am glad I was able to help. What vms are you running? I maybe able to replicate this and send you the proper format for the hosts.yaml