Merge "Fix rsyslog_client_log_dir to be optional"
This commit is contained in:
commit
c0a2d4df9d
|
@ -26,6 +26,7 @@ rsyslog_client_spool_directory: /var/spool/rsyslog
|
|||
# discovery process. This will force the logs from a given directory
|
||||
# to be shipped using rsyslog.
|
||||
# rsyslog_client_log_dir: /var/log/project
|
||||
rsyslog_client_log_dir: false
|
||||
|
||||
# Set the `rsyslog_client_log_files` variable in list format to skip
|
||||
# log discovery all together and ship only log files that are explicitly
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
- name: Check if log dir exists
|
||||
stat:
|
||||
path: "{{ rsyslog_client_log_dir }}"
|
||||
when:
|
||||
- "{{ rsyslog_client_log_dir | bool }}"
|
||||
register: log_dir
|
||||
|
||||
- name: Find all log files
|
||||
|
@ -37,7 +39,7 @@
|
|||
register: log_files
|
||||
changed_when: false
|
||||
when:
|
||||
- rsyslog_client_log_dir is defined
|
||||
- not log_dir | skipped
|
||||
- log_dir.stat.isdir is defined and log_dir.stat.isdir
|
||||
tags:
|
||||
# do not trigger ANSIBLE0013 as shell is indeed needed here
|
||||
|
|
Loading…
Reference in New Issue