Ansible syslogs to user.notice on the managed machine - can I change this?

21 views
Skip to first unread message

Ed Greenberg

unread,
Jul 11, 2017, 3:34:47 PM7/11/17
to Ansible Project
I have a task logging to user.notice, and I can't change it. 

Ansible also logs to user.notice, and I'm wondering if I can change where it does that on a global basis. One of the locals would be nice.

Any way to do this?

Ed Greenberg

Brian Coca

unread,
Jul 11, 2017, 3:45:04 PM7/11/17
to Ansible Project
You can turn it off with no_target_syslog config entry, but there is
no current way of changing the logging target.

----------
Brian Coca

Ed Greenberg

unread,
Jul 12, 2017, 9:05:26 AM7/12/17
to Ansible Project

This is how I solved the problem in rsyslog.conf:

if $pri-text == 'user.notice' and $msg contains 'ansible' then {
   
/var/log/ansible.log
    stop
}


I put this pretty close to the top of the rsyslog.conf, above GLOBAL DIRECTIVES.
Reply all
Reply to author
Forward
0 new messages