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
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
---
|
|
- name: Check if cron is installed
|
|
ansible.builtin.shell:
|
|
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
|
executable: /bin/bash
|
|
check_mode: no
|
|
failed_when: False
|
|
changed_when: False
|
|
register: is_cron_installed
|
|
|
|
- name: "log rotation script"
|
|
ansible.builtin.template:
|
|
src: rotate_logstash_logs.j2
|
|
dest: /etc/cron.daily/rotate_logstash_logs
|
|
owner: root
|
|
group: root
|
|
mode: "0750"
|
|
when: is_cron_installed.rc == 0
|
|
|
|
- name: "Create a system config directory for systemd overrides"
|
|
ansible.builtin.file:
|
|
path: /etc/systemd/system/logstash.service.d
|
|
state: directory
|
|
|
|
- name: "disable syslog"
|
|
community.general.ini_file:
|
|
path: /etc/systemd/system/logstash.service.d/override.conf
|
|
section: Service
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
create: yes
|
|
no_extra_spaces: yes
|
|
state: "{{ logstash_log_syslog_enabled | bool | ternary('absent','present') }}"
|
|
loop:
|
|
- { option: "StandardOutput", value: "null" }
|
|
- { option: "StandardError", value: "null" }
|
|
notify:
|
|
- restart logstash |