Fix rsyslog_client_log_dir to be optional

Fix the regression introduced in
I371d0bbbd1f9dfa893df054471f17f5cc4b640df which causes
the role to fail if a log directory is not provided.

Change-Id: Iba17bed79e26e6e7eb2300d413058145ec680d87
This commit is contained in:
Logan V 2016-11-11 21:57:41 -06:00
parent 81be10cec1
commit 16f933ab12
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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