*1. For Playbook implemented see below:* # Install mongodb --- - hosts: server tasks: - name: Add mongo ppa key sudo: yes apt_key: > keyserver=hkp://keyserver.ubuntu.com:80 id=7F0CEB10 state=present - name: Add mongo sources list sudo: yes lineinfile: > line="deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" dest=/etc/apt/sources.list.d/mongodb.list state=present create=yes - name: Install mongo sudo: yes apt: > name=mongodb-org state=latest update_cache=yes *2. Getting below error on running the above playbook while installing mongoDB on remote server.*
TASK [Install mongo] *************************************************************************************************************************************************************************************** [WARNING]: Updating cache and auto-installing missing dependency: python-apt fatal: [10.0.2.12]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "E: Malformed entry 2 in list file /etc/apt/sources.list.d/mongodb.list (Component)\nE: The list of sources could not be read.", "rc": 100, "stderr": "E: Malformed entry 2 in list file /etc/apt/sources.list.d/mongodb.list (Component)\nE: The list of sources could not be read.\n", "stderr_lines": ["E: Malformed entry 2 in list file /etc/apt/sources.list.d/mongodb.list (Component)", "E: The list of sources could not be read."], "stdout": "", "stdout_lines": []} PLAY RECAP ************************************************************************************************************************************************************************************************* 10.0.2.12 : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/7ef777cf-7ebe-4dc1-9812-e3a7fd3315b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.