forked from evolix/ansible-roles
34 lines
630 B
YAML
34 lines
630 B
YAML
---
|
|
|
|
- name: Install packages
|
|
apt:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
with_items:
|
|
- mongodb
|
|
- mongo-tools
|
|
|
|
- name: install dependency for monitoring
|
|
apt:
|
|
name: python-pymongo
|
|
state: installed
|
|
|
|
- name: Custom configuration
|
|
template:
|
|
src: mongodb_stretch.conf.j2
|
|
dest: "/etc/mongodb.conf"
|
|
force: "{{ mongodb_force_config | bool | ternary('yes', 'no') }}"
|
|
notify: restart mongodb
|
|
|
|
- name: enable service
|
|
service:
|
|
name: mongodb
|
|
enabled: yes
|
|
|
|
- name: Configure logrotate
|
|
template:
|
|
src: logrotate_stretch.j2
|
|
dest: /etc/logrotate.d/mongodb
|
|
force: yes
|
|
backup: no
|