ansible-roles/mongodb/tasks/main_stretch.yml

39 lines
812 B
YAML
Raw Normal View History

---
- name: Install packages
apt:
2019-12-31 15:25:10 +01:00
name:
- mongodb
- mongo-tools
state: present
- name: install dependency for monitoring
apt:
name: python-pymongo
state: present
- 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
2018-04-05 18:43:29 +02:00
dest: /etc/logrotate.d/mongodb-server
force: yes
backup: no
2018-04-05 18:43:29 +02:00
- name: disable previous logrotate
command: mv /etc/logrotate.d/mongodb /etc/logrotate.d/mongodb.disabled
args:
removes: /etc/logrotate.d/mongodb
creates: /etc/logrotate.d/mongodb.disabled