getting error while installing mongoDB on remote ubuntu server via ansible

1. For Playbook implemented see below:

Install mongodb

It looks like the issue is with the list apt uses to retrieve sources…

Malformed entry 2 in list file /etc/apt/sources.list.d/mongodb.list (Component)\nE: The list of sources could not be read.
#ref

You may have to template in the file if it’s not present on the target.

Hope that helps