rsyslog: use variables for paths
This commit is contained in:
parent
01314cb137
commit
9acc10b73f
@ -33,3 +33,9 @@ rsyslog_default_rules_state: file
|
||||
rsyslog_default_rules: []
|
||||
rsyslog_rules: []
|
||||
rsyslog_archival_format_enabled: false
|
||||
|
||||
rsyslog_etc_path: /etc/rsyslog.d
|
||||
rsyslog_config_path: /etc/rsyslog.conf
|
||||
|
||||
rsyslog_d:
|
||||
[]
|
@ -50,7 +50,7 @@
|
||||
- name: configure archival format
|
||||
template:
|
||||
src: archival.conf.j2
|
||||
dest: /etc/rsyslog.d/10-archival.conf
|
||||
dest: "{{ rsyslog_etc_path }}/10-archival.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
- name: manage archive rules
|
||||
file:
|
||||
path: /etc/rsyslog.d/10-archival.conf
|
||||
path: "{{ rsyslog_etc_path }}/10-archival.conf"
|
||||
state: "{{ rsyslog_archival_format_enabled | ternary('file', 'absent') }}"
|
||||
|
||||
- name: compress log cron job
|
||||
|
@ -14,7 +14,7 @@
|
||||
- name: configure
|
||||
template:
|
||||
src: rsyslog.conf.j2
|
||||
dest: /etc/rsyslog.conf
|
||||
dest: "{{ rsyslog_config_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
@ -26,7 +26,7 @@
|
||||
- name: configure default rules
|
||||
template:
|
||||
src: default.conf.j2
|
||||
dest: /etc/rsyslog.d/50-default.conf
|
||||
dest: "{{ rsyslog_etc_path }}/50-default.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
@ -35,8 +35,19 @@
|
||||
|
||||
- name: manage default rules
|
||||
file:
|
||||
path: /etc/rsyslog.d/50-default.conf
|
||||
path: "{{ rsyslog_etc_path }}/50-default.conf"
|
||||
state: "{{ rsyslog_default_rules_state }}"
|
||||
notify: restart rsyslog
|
||||
|
||||
- name: configure rsyslog.d rules
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ rsyslog_etc_path }}/{{ item.priority }}-{{ item.name }}.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: "{{ item.content }}"
|
||||
loop: "{{ rsyslog_d | default([]) }}"
|
||||
notify: restart rsyslog
|
||||
|
||||
- name: manage service
|
||||
service:
|
||||
|
Loading…
Reference in New Issue
Block a user