---
- name: MongoDB package installed
  community.general.pkgng:
    name: "mongodb60"
    state: latest

- name: MongoDB enabled
  shell:
    cmd: sysrc mongodb_enable="YES"

- name: Mongo conf installed
  copy:
    src: mongodb.conf.j2
    dest: /usr/local/etc/mongodb.conf
    owner: root
    mode: 0644
  notify: Mongodb restarted

- name: MongoDB started
  service: name=mongodb state=started
