Ansible apt module question (Repository issues)

Hi,

i,m getting the “public key is not avaiable” error while using the apt module.(installing zabbix agent)
I know i could just add the key, but my question is:

Why does this error occure while im using ansible and its apt-module, but if i log into the server directly and use apt install i wont get any errors?
Shouldn’t this be exactly the same or whats the difference?

kind regards

Solved, it was just because ansible does a apt-update before installing an package.