---
#  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

- name: Add MongoDB apt key
  apt_key:  id=7F0CEB10
            url=hkp://keyserver.ubuntu.com:80
  tags:
    - install
    - mongodb

- name: Add MongoDB repository
  apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen'
                  state=present
                  update_cache=yes
  tags:
    - install
    - mongodb

- name: Install MongoDB
  apt:  name=mongodb-10gen
        state=latest
  tags:
    - install
    - mongodb

---
#  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

- name: Add MongoDB apt key
  apt_key:  id=7F0CEB10
            url=hkp://keyserver.ubuntu.com:80
  tags:
    - install
    - mongodb

- name: Add MongoDB repository
  apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen'
                  state=present
                  update_cache=yes
  tags:
    - install
    - mongodb

- name: Install MongoDB
  apt:  name=mongodb-10gen
        state=latest
  tags:
    - install
    - mongodb

- name: Make sure MongoDB is running
  service:  name=mongodb
            state=started
  tags:
    - install
    - mongodb

Make usre mongodb is running.
Make usre mongodb is running.
