�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l Z d
� Z
d � Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys
---
module: syslogger
short_description: Log messages in the syslog
version_added: "2.4"
description:
- "Uses syslog to add log entries to the host."
- "Can specify facility and priority."
options:
msg:
description:
- This is the message to place in syslog
required: true
priority:
description:
- Set the log priority
choices: [ "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug" ]
required: false
default: "info"
facility:
description:
- Set the log facility
choices: [ "kern", "user", "mail", "daemon", "auth", "lpr", "news",
"uucp", "cron", "syslog", "local0", "local1", "local2",
"local3", "local4", "local5", "local6", "local7" ]
required: false
default: "daemon"
log_pid:
description:
- Log the pid in brackets
type: bool
required: false
default: "no"
author:
- Tim Rightnour (@garbled1)
s�
# Full example
- name: Test syslog
syslogger:
msg: "Hello from ansible"
priority: "err"
facility: "daemon"
log_pid: true
# Basic usage
- name: Simple Usage
syslogger:
msg: "I will end up as daemon.info"
t
( t
AnsibleModuleNc C` s� i t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j
d
6t j d 6t j d 6t j
d
6t j d 6t j d 6t j d 6t j d 6t j d 6j | t j � S( Nt kernt usert mailt daemont autht lprt newst uucpt cront syslogt local0t local1t local2t local3t local4t local5t local6t local7( R t LOG_KERNt LOG_USERt LOG_MAILt
LOG_DAEMONt LOG_AUTHt LOG_LPRt LOG_NEWSt LOG_UUCPt LOG_CRONt
LOG_SYSLOGt
LOG_LOCAL0t
LOG_LOCAL1t
LOG_LOCAL2t
LOG_LOCAL3t
LOG_LOCAL4t
LOG_LOCAL5t
LOG_LOCAL6t
LOG_LOCAL7t get( t x( ( sJ /usr/lib/python2.7/site-packages/ansible/modules/notification/syslogger.pyt get_facilityM s(
c C` sc i t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6t j d 6j | t j � S( Nt emergt alertt critt errt warningt noticet infot debug(
R t LOG_EMERGt LOG_ALERTt LOG_CRITt LOG_ERRt LOG_WARNINGt
LOG_NOTICEt LOG_INFOt LOG_DEBUGR. ( R/ ( ( sJ /usr/lib/python2.7/site-packages/ansible/modules/notification/syslogger.pyt get_priorityd s
c C` s� t d t d d d t � d t d d d t d d d d d
d d d
d g d d
� d t d d d t d d d d d d d d d d d d d d d d d d! d"