ansible.builtin.syslogger (v2.9.27) — module

Log messages in the syslog

| "added in version" 2.4 of ansible.builtin"

Authors: Tim Rightnour (@garbled1)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Uses syslog to add log entries to the host.

Can specify facility and priority.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Full example
- name: Test syslog
  syslogger:
    msg: "Hello from ansible"
    priority: "err"
    facility: "daemon"
    log_pid: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Basic usage
- name: Simple Usage
  syslogger:
    msg: "I will end up as daemon.info"

Inputs

    
msg:
    description:
    - This is the message to place in syslog
    required: true

log_pid:
    default: 'no'
    description:
    - Log the pid in brackets
    required: false
    type: bool

facility:
    choices:
    - kern
    - user
    - mail
    - daemon
    - auth
    - lpr
    - news
    - uucp
    - cron
    - syslog
    - local0
    - local1
    - local2
    - local3
    - local4
    - local5
    - local6
    - local7
    default: daemon
    description:
    - Set the log facility
    required: false

priority:
    choices:
    - emerg
    - alert
    - crit
    - err
    - warning
    - notice
    - info
    - debug
    default: info
    description:
    - Set the log priority
    required: false