Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
40 lines
917 B
YAML
40 lines
917 B
YAML
---
|
|
|
|
- name: Install packages
|
|
ansible.builtin.apt:
|
|
name:
|
|
- mongodb
|
|
- mongo-tools
|
|
state: present
|
|
|
|
- name: install dependency for monitoring
|
|
ansible.builtin.apt:
|
|
name: python-pymongo
|
|
state: present
|
|
|
|
- name: Custom configuration
|
|
ansible.builtin.template:
|
|
src: mongodb_stretch.conf.j2
|
|
dest: "/etc/mongodb.conf"
|
|
force: "{{ mongodb_force_config | bool | ternary('yes', 'no') }}"
|
|
notify: restart mongodb
|
|
|
|
- name: enable service
|
|
ansible.builtin.service:
|
|
name: mongodb
|
|
enabled: yes
|
|
|
|
- name: Configure logrotate
|
|
ansible.builtin.template:
|
|
src: logrotate_stretch.j2
|
|
dest: /etc/logrotate.d/mongodb-server
|
|
force: yes
|
|
backup: no
|
|
|
|
- name: disable previous logrotate
|
|
ansible.builtin.command:
|
|
cmd: mv /etc/logrotate.d/mongodb /etc/logrotate.d/mongodb.disabled
|
|
args:
|
|
removes: /etc/logrotate.d/mongodb
|
|
creates: /etc/logrotate.d/mongodb.disabled
|