feat: use ansible block

This commit is contained in:
Simon Cornet 2025-03-31 18:19:09 +02:00
commit b5c819fb27
12 changed files with 399 additions and 424 deletions

View file

@ -1,53 +1,52 @@
---
# configure rsyslogd - debian
- name: "syslog - config - rsyslog - debian"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.debian.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Debian"'
notify: "restart rsyslog"
tags:
- "syslog"
# manage syslog
- name: "manage syslog"
block:
# configure rsyslogd - ubuntu
- name: "syslog - config - rsyslog - ubuntu"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.ubuntu.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Ubuntu"'
notify: "restart rsyslog"
tags:
- "syslog"
# configure rsyslogd - debian
- name: "syslog - config - rsyslog - debian"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.debian.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Debian"'
notify: "restart rsyslog"
# configure rsyslogd - apt
- name: "syslog - config - apt"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/apt.conf.j2"
dest: "/etc/rsyslog.d/apt.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"
tags:
- "syslog"
# configure rsyslogd - ubuntu
- name: "syslog - config - rsyslog - ubuntu"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.ubuntu.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Ubuntu"'
notify: "restart rsyslog"
# configure rsyslogd - apt
- name: "syslog - config - apt"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/apt.conf.j2"
dest: "/etc/rsyslog.d/apt.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"
# configure rsyslogd - observium
- name: "syslog - config - remote-logging"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/remote-logging.j2"
dest: "/etc/rsyslog.d/remote-logging.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"
# configure rsyslogd - observium
- name: "syslog - config - remote-logging"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/remote-logging.j2"
dest: "/etc/rsyslog.d/remote-logging.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"
tags:
- "syslog"