- set_fact: role_name=api-db

- name: install mongodb
  apt: name={{ item }} state=present
  with_items:
    - mongodb

- name: open mongodb to external services
  lineinfile: dest=/etc/mongodb.conf regexp=^bind_ip line="bind_ip = 0.0.0.0"
  when: is_development_environment
  notify:
    - restart mongodb service

- set_fact: role_name=api-db

- name: install mongodb
  apt: name={{ item }} state=present
  with_items:
    - mongodb

- name: open mongodb to external services
  lineinfile: dest=/etc/mongodb.conf regexp=^bind_ip line="bind_ip = 0.0.0.0"
  when: is_development_environment
  notify:
    - restart mongodb service

- name: add elasticsearch apt key
  apt_key:
    url: https://packages.elastic.co/GPG-KEY-elasticsearch
    state: present

- name: add elasticsearch repository
  apt_repository:
    repo: 'deb http://packages.elastic.co/elasticsearch/2.x/debian stable main'
    state: present
    update_cache: yes

- name: install elasticsearch dependencies
  apt: name={{ item }} state=present
  with_items:
    - openjdk-7-jre

- name: install elasticsearch
  apt: name=elasticsearch state=present

Install elasticsearch in the "app-db" role.
Install elasticsearch in the "app-db" role.
