Add rsyslog role
This commit is contained in:
27
roles/rsyslog/templates/archival.conf.j2
Normal file
27
roles/rsyslog/templates/archival.conf.j2
Normal file
@ -0,0 +1,27 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
template(
|
||||
name="FilePerDay"
|
||||
type="list"
|
||||
) {
|
||||
constant(value="/var/log/syslog/")
|
||||
property(name="hostname")
|
||||
constant(value="/")
|
||||
property(name="syslogfacility-text")
|
||||
constant(value="/")
|
||||
property(name="timereported" dateformat="year")
|
||||
property(name="timereported" dateformat="month")
|
||||
constant(value="/")
|
||||
property(name="timereported" dateformat="year")
|
||||
property(name="timereported" dateformat="month")
|
||||
property(name="timereported" dateformat="day")
|
||||
constant(value="-")
|
||||
property(name="syslogfacility-text")
|
||||
constant(value=".log")
|
||||
}
|
||||
|
||||
*.* action(
|
||||
type="omfile"
|
||||
dynafile="FilePerDay"
|
||||
template="RSYSLOG_FileFormat"
|
||||
)
|
5
roles/rsyslog/templates/default.conf.j2
Normal file
5
roles/rsyslog/templates/default.conf.j2
Normal file
@ -0,0 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for rule in rsyslog_default_rules %}
|
||||
{{ rule }}
|
||||
{% endfor %}
|
47
roles/rsyslog/templates/rsyslog.conf.j2
Normal file
47
roles/rsyslog/templates/rsyslog.conf.j2
Normal file
@ -0,0 +1,47 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for module in rsyslog_load_modules | default([]) %}
|
||||
{% if module.enabled | default(true) %}
|
||||
module(
|
||||
load="{{ module.name }}"
|
||||
{% if module.params is defined and module.params is mapping %}
|
||||
{% for k, v in module.params.items() | default({}) %}
|
||||
{{ k }}="{{ v }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
)
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if rsyslog_action_file_default_template is defined %}
|
||||
$ActionFileDefaultTemplate {{ rsyslog_action_file_default_template }}
|
||||
{% endif %}
|
||||
|
||||
{% if rsyslog_repeated_msg_reduction is defined %}
|
||||
$RepeatedMsgReduction {{ rsyslog_repeated_msg_reduction }}
|
||||
{% endif %}
|
||||
|
||||
{% if rsyslog_file_owner is defined %}
|
||||
$FileOwner {{ rsyslog_file_owner }}
|
||||
{% endif %}
|
||||
{% if rsyslog_file_group is defined %}
|
||||
$FileGroup {{ rsyslog_file_group }}
|
||||
{% endif %}
|
||||
{% if rsyslog_file_create_mode is defined %}
|
||||
$FileCreateMode {{ rsyslog_file_create_mode }}
|
||||
{% endif %}
|
||||
{% if rsyslog_dir_create_mode is defined %}
|
||||
$DirCreateMode {{ rsyslog_dir_create_mode }}
|
||||
{% endif %}
|
||||
{% if rsyslog_umask is defined %}
|
||||
$Umask {{ rsyslog_umask }}
|
||||
{% endif %}
|
||||
{% if rsyslog_priv_drop_to_user is defined %}
|
||||
$PrivDropToUser {{ rsyslog_priv_drop_to_user }}
|
||||
{% endif %}
|
||||
{% if rsyslog_priv_drop_to_group is defined %}
|
||||
$PrivDropToGroup {{ rsyslog_priv_drop_to_group }}
|
||||
{% endif %}
|
||||
|
||||
$WorkDirectory {{ rsyslog_work_directory }}
|
||||
$IncludeConfig {{ rsyslog_include_config }}
|
5
roles/rsyslog/templates/rules.conf.j2
Normal file
5
roles/rsyslog/templates/rules.conf.j2
Normal file
@ -0,0 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for rule in rsyslog_rules %}
|
||||
{{ rule }}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user