522 iocage templates ansible_syslogng_*

Use case

Configure and run a log server. Configure log clients and test them. Use syslog-ng. Create templates ansible_syslogng_server and ansible_syslogng_client. Create the jails from the templates.

Tree

shell > tree .
.
├── ansible.cfg
├── files
│   ├── pkgs-logclient.json
│   └── pkgs-logserver.json
├── group_vars
│   └── all
│       └── common.yml
├── hosts
│   └── 05_iocage.yml
├── host_vars
│   ├── ansible_syslogng_client
│   │   └── syslog-ng-client.yml
│   ├── ansible_syslogng_server
│   │   └── syslog-ng-server.yml
│   └── iocage_05
│       └── template.yml
├── iocage.ini
├── pb-create-jails.yml
├── pb-logclient-conf.yml
├── pb-logclient-test.yml
├── pb-logclient.yml
├── pb-logserver-test.yml
├── pb-logserver.yml
└── pb-template-stop-convert.yml

Synopsis

  • At a managed node:

    Use the role vbotka.freebsd.iocage_template to create templates:

    • ansible_syslogng_server

    • ansible_syslogng_client

    In the playbook pb-create-jails.yml:

    • Create jails from the created templates

  • In the inventory group log_server test syslog-ng server.

  • In the inventory group log_client configure and test syslog-ng client.

Requirements

Notes

  • Quoting syslog-ng - FreeBSD Wiki:

    One of the most typical use of syslog-ng is central log aggregation. … It collects log messages on TCP port 514 and saves them to directories and files based on sender host name and current date.

Note

ansible.cfg

[defaults]
callback_result_format = yaml
deprecation_warnings = false
display_skipped_hosts = false
gathering = explicit
interpreter_python = auto_silent
log_path = /var/log/ansible.log

[connection]
pipelining = true

Inventory iocage.ini

iocage_05

[iocage]
iocage_05

[iocage:vars]
ansible_user=admin
ansible_become=true
ansible_python_interpreter=auto_silent

hosts

hosts/05_iocage.yml
plugin: vbotka.freebsd.iocage
host: iocage_05
user: admin
sudo: true
get_properties: true

compose:
  iocage_tags: dict(iocage_properties.notes | regex_findall('(\w+)=([\w\-]+)'))
  iocage_classes: iocage_properties.notes | regex_findall('(?<=class=)[\w\-]+|(?<=,)[\w\-]+')
# connection plugin vbotka.freebsd.jailexec
  ansible_connection: "'vbotka.freebsd.jailexec'"
  ansible_jail_host: dict(iocage_properties.notes | regex_findall('(\w+)=([\w\-]+)')).vmm | d('none')
  ansible_jail_name: iocage_jid
  ansible_jail_privilege_escalation: "'sudo'"

groups:
  log_server: iocage_classes is contains('log-server')
  log_client: iocage_classes is contains('log-client')

keyed_groups:
  - prefix: state
    key: iocage_state
  - prefix: vmm
    key: iocage_tags.vmm

group_vars

group_vars/all/common.yml
ansible_python_interpreter: auto_silent

host_vars

host_vars/ansible_syslogng_client/syslog-ng-client.yml
fp_syslogd: true
fp_syslogd_enable: false
fp_syslogd_conf_sanity: false

fp_syslogng: true
fp_syslogng_enable: false
fp_syslogng_conf_template: syslog-ng.conf.j2
fp_syslogng_conf:
  header:
    - '@version:4.8'
    - '@include "scl.conf"'
  options:
    - threaded(yes)
    - group("wheel")
    - perm(0640)
  source:
    s_system:
      - unix-dgram("/var/run/log")
      - unix-dgram("/var/run/logpriv" perm(0600))
      - internal()
    s_ansible:
      - file("/var/log/ansible.log" follow-freq(1) program-override("ansible"))
  destination:
    d_network:
      - network("LOG_SERVER" port(514) transport("tcp"))
  filter:
    f_messages:
      - level(info..emerg) and not facility(auth, authpriv, lpr, mail, news, daemon)
    f_daemon:
      - facility(daemon)
  log:
    - source: s_system
      filter: f_daemon
      destination: d_network
    - source: s_system
      filter: f_messages
      destination: d_network
    - source: s_ansible
      destination: d_network
host_vars/ansible_syslogng_server/syslog-ng-server.yml
fp_syslogd: true
fp_syslogd_enable: false
fp_syslogd_conf_sanity: false

fp_syslogng: true
fp_syslogng_enable: true
fp_syslogng_conf_template: syslog-ng.conf.j2
fp_syslogng_conf:
  header:
    - '@version:4.8'
    - '@include "scl.conf"'
  options:
    - threaded(yes)
    - group("wheel")
    - perm(0640)
  source:
    s_system:
      - unix-dgram("/var/run/log")
      - unix-dgram("/var/run/logpriv" perm(0600))
      - internal()
    s_ansible:
      - file("/var/log/ansible.log" follow-freq(1) program-override("ansible"))
    s_remote:
      - tcp(port(514))
  destination:
    d_local:
      - file("/var/log/remote/${HOST}/${YEAR}_${MONTH}_${DAY}.log" create-dirs(yes))
  filter:
    f_messages:
      - level(notice..emerg) and not facility(auth, authpriv, lpr, mail, news, daemon)
    f_daemon:
      - facility(daemon)
  log:
    - source: s_remote
      destination: d_local
    - source: s_system
      filter: f_daemon
      destination: d_local
    - source: s_system
      filter: f_messages
      destination: d_local
    - source: s_ansible
      destination: d_local
host_vars/iocage_05/template.yml
freebsd_iocage_mount: /zroot/iocage

fit_templates:
  ansible_syslogng_server:
    release: 15.0-RELEASE
    pkglist: /tmp/ansible/ansible_syslogng_server/pkgs-logserver.json
    properties:
      bpf: 1
      dhcp: 1
      vnet: 1
      notes: "vmm={{ inventory_hostname }}"
  ansible_syslogng_client:
    release: 15.0-RELEASE
    pkglist: /tmp/ansible/ansible_syslogng_client/pkgs-logclient.json
    properties:
      bpf: 1
      dhcp: 1
      vnet: 1
      notes: "vmm={{ inventory_hostname }}"

fit_stop: false
fit_template: false

# jail properties
properties:
  bpf: 1
  dhcp: 1
  vnet: 1
  boot: 1

log_clients:
  - foo
  - bar

files

files/pkgs-logclient.json
{
    "pkgs": [
        "sudo",
	"syslog-ng"
        ]
}
files/pkgs-logserver.json
{
    "pkgs": [
        "lnav",
        "sudo",
	"syslog-ng"
        ]
}

Playbook pb-iocage-template.yml

---
- name: Create iocage templates.
  hosts: iocage

  roles:

    - vbotka.freebsd.iocage_template

Playbook output - Create iocage templates

(env) > ansible-playbook pb-iocage-template.yml -i iocage.ini
PLAY [Create Ansible client templates.] ****************************************

TASK [vbotka.freebsd.iocage_template : Setup: Get iocage list of templates.] ***
ok: [iocage_05]

TASK [vbotka.freebsd.iocage_template : Pkglist: Create directories for pkglist files.] ***
ok: [iocage_05] => (item=ansible_syslogng_server /tmp/ansible/ansible_syslogng_server/pkgs-logserver.json)
ok: [iocage_05] => (item=ansible_syslogng_client /tmp/ansible/ansible_syslogng_client/pkgs-logclient.json)

TASK [vbotka.freebsd.iocage_template : Pkglist: Copy pkglist files.] ***********
ok: [iocage_05] => (item=ansible_syslogng_server /tmp/ansible/ansible_syslogng_server/pkgs-logserver.json)
ok: [iocage_05] => (item=ansible_syslogng_client /tmp/ansible/ansible_syslogng_client/pkgs-logclient.json)

TASK [vbotka.freebsd.iocage_template : Create: Create templates.] **************
changed: [iocage_05] => (item=ansible_syslogng_server 15.0-RELEASE)
changed: [iocage_05] => (item=ansible_syslogng_client 15.0-RELEASE)

TASK [vbotka.freebsd.iocage_template : Start: Get iocage list of jails.] *******
ok: [iocage_05]

TASK [vbotka.freebsd.iocage_template : Start: Start created templates.] ********
ok: [iocage_05]

PLAY RECAP *********************************************************************
iocage_05                  : ok=6    changed=1    unreachable=0    failed=0    skipped=29   rescued=0    ignored=0   

Playbook pb-logserver.yml

---
- name: Configure and start Log Server.
  hosts: ansible_syslogng_server
    
  tasks:

    - name: Stop and disable syslogd
      ansible.builtin.import_role:
        name: vbotka.freebsd.postinstall
        tasks_from: syslogd.yml

    - name: Configure and start syslog-ng
      ansible.builtin.import_role:
        name: vbotka.freebsd.postinstall
        tasks_from: syslog-ng.yml

Playbook output - Configure and start Log Server

(env) > ansible-playbook pb-logserver.yml -i hosts
PLAY [Configure and start Log Server.] *****************************************

TASK [vbotka.freebsd.postinstall : Rcconf: Configure syslogd_enable in /etc/rc.conf] ***
changed: [ansible_syslogng_server]

TASK [vbotka.freebsd.postinstall : Syslog-ng: Sanity fp_syslogng_conf is empty.] ***
ok: [ansible_syslogng_server]

TASK [vbotka.freebsd.postinstall : Syslog-ng: Configure /usr/local/etc/syslog-ng.conf] ***
changed: [ansible_syslogng_server]

TASK [vbotka.freebsd.postinstall : Rcconf: Configure syslog_ng_enable in /etc/rc.conf] ***
changed: [ansible_syslogng_server]

RUNNING HANDLER [vbotka.freebsd.postinstall : Start syslog-ng] *****************
changed: [ansible_syslogng_server]

RUNNING HANDLER [vbotka.freebsd.postinstall : Reload syslog-ng] ****************
ok: [ansible_syslogng_server]

RUNNING HANDLER [vbotka.freebsd.postinstall : Stop syslogd] ********************
ok: [ansible_syslogng_server]

PLAY RECAP *********************************************************************
ansible_syslogng_server    : ok=7    changed=4    unreachable=0    failed=0    skipped=19   rescued=0    ignored=0   

Playbook pb-logclient.yml

---
- name: Configure Log Client.
  hosts: ansible_syslogng_client
    
  tasks:

    - name: Stop and disable syslogd
      ansible.builtin.import_role:
        name: vbotka.freebsd.postinstall
        tasks_from: syslogd.yml

    - name: Configure syslog-ng
      ansible.builtin.import_role:
        name: vbotka.freebsd.postinstall
        tasks_from: syslog-ng.yml

Playbook output - Configure Log Client

(env) > ansible-playbook pb-logclient.yml -i hosts
PLAY [Configure Log Client.] ***************************************************

TASK [vbotka.freebsd.postinstall : Rcconf: Configure syslogd_enable in /etc/rc.conf] ***
changed: [ansible_syslogng_client]

TASK [vbotka.freebsd.postinstall : Syslog-ng: Sanity fp_syslogng_conf is empty.] ***
ok: [ansible_syslogng_client]

TASK [vbotka.freebsd.postinstall : Syslog-ng: Configure /usr/local/etc/syslog-ng.conf] ***
changed: [ansible_syslogng_client]

TASK [vbotka.freebsd.postinstall : Rcconf: Configure syslog_ng_enable in /etc/rc.conf] ***
changed: [ansible_syslogng_client]

RUNNING HANDLER [vbotka.freebsd.postinstall : Stop syslog-ng] ******************
ok: [ansible_syslogng_client]

RUNNING HANDLER [vbotka.freebsd.postinstall : Stop syslogd] ********************
changed: [ansible_syslogng_client]

PLAY RECAP *********************************************************************
ansible_syslogng_client    : ok=6    changed=4    unreachable=0    failed=0    skipped=20   rescued=0    ignored=0   

Playbook pb-template-stop-convert.yml

---
- name: Stop and convert ansible_syslogng_* to templates.
  hosts: iocage_05

  tasks:

    - name: Stop ansible_syslogng_client and ansible_syslogng_server
      ansible.builtin.command: iocage stop ansible_syslogng_client ansible_syslogng_server

    - name: Convert ansible_syslogng_client jail to template.
      ansible.builtin.command: iocage set template=1 ansible_syslogng_client

    - name: Convert ansible_syslogng_server jail to template.
      ansible.builtin.command: iocage set template=1 ansible_syslogng_server

Playbook output - Stop and convert ansible_syslogng_* to templates

(env) > ansible-playbook pb-template-stop-convert.yml -i iocage.ini
PLAY [Stop and convert ansible_syslogng_* to templates.] ***********************

TASK [Stop ansible_syslogng_client and ansible_syslogng_server] ****************
changed: [iocage_05]

TASK [Convert ansible_syslogng_client jail to template.] ***********************
changed: [iocage_05]

TASK [Convert ansible_syslogng_server jail to template.] ***********************
changed: [iocage_05]

PLAY RECAP *********************************************************************
iocage_05                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

List templates

shell > ssh admin@iocage_05 sudo iocage list -lt
+------+-------------------------+------+-------+----------+--------------+--------------------+-----+----------+----------+
| JID  |          NAME           | BOOT | STATE |   TYPE   |   RELEASE    |        IP4         | IP6 | TEMPLATE | BASEJAIL |
+======+=========================+======+=======+==========+==============+====================+=====+==========+==========+
| None | ansible_pull_repos      | off  | down  | template | 15.0-RELEASE | DHCP (not running) | -   | -        | no       |
+------+-------------------------+------+-------+----------+--------------+--------------------+-----+----------+----------+
| None | ansible_syslogng_client | off  | down  | template | 15.0-RELEASE | DHCP (not running) | -   | -        | no       |
+------+-------------------------+------+-------+----------+--------------+--------------------+-----+----------+----------+
| None | ansible_syslogng_server | off  | down  | template | 15.0-RELEASE | DHCP (not running) | -   | -        | no       |
+------+-------------------------+------+-------+----------+--------------+--------------------+-----+----------+----------+

Playbook pb-create-jails.yml

---
- name: Create jails from iocage templates.
  hosts: iocage_05

  tasks:

    - name: Create syslog-ng server.
      vars:
        _notes: >
          "vmm={{ inventory_hostname }}
          class=log-server"
      ansible.builtin.command: >
        iocage create
        --name log-server
        --template ansible_syslogng_server
        {{ properties | dictsort | map('join', '=') | join(' ') }}
        notes={{ _notes }}

    - name: Create syslog-ng clients.
      vars:
        _notes: >
          "vmm={{ inventory_hostname }}
          class=log-client"
      ansible.builtin.command: >
        iocage create
        --name {{ item }}
        --template ansible_syslogng_client
        {{ properties | dictsort | map('join', '=') | join(' ') }}
        notes={{ _notes }}
      loop: "{{ log_clients }}"

Playbook output - Create jails from iocage templates

(env) > ansible-playbook pb-create-jails.yml.yml -i iocage.ini
PLAY [Create jails from iocage templates.] *************************************

TASK [Create syslog-ng server.] ************************************************
changed: [iocage_05]

TASK [Create syslog-ng clients.] ***********************************************
changed: [iocage_05] => (item=foo)
changed: [iocage_05] => (item=bar)

PLAY RECAP *********************************************************************
iocage_05                  : ok=2    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Inventory graph

shell > ansible-inventory -i hosts --graph
@all:
  |--@ungrouped:
  |--@log_client:
  |  |--bar
  |  |--foo
  |--@state_up:
  |  |--bar
  |  |--foo
  |  |--log-server
  |  |--repos
  |  |--repos-dev
  |--@vmm_iocage_05:
  |  |--bar
  |  |--foo
  |  |--log-server
  |  |--repos
  |  |--repos-dev
  |--@log_server:
  |  |--log-server

Playbook pb-logclient-conf.yml

---
- name: Configure, enable, and start Log Clients.
  hosts: log_client

  vars:

    log_server: "{{ hostvars['log-server']['iocage_ip4'] }}"

  tasks:

    - name: Display vars.
      when: debug | d(false) | bool
      run_once: true
      ansible.builtin.debug:
        msg: |
          log_server: {{ log_server }}
          log_client: {{ groups.log_client }}

    - name: Configure LOG_SERVER
      ansible.builtin.lineinfile:
        dest: /usr/local/etc/syslog-ng.conf
        regexp: ^(.*)LOG_SERVER(.*)$
        line: '\g<1>{{ log_server }}\g<2>'
        backrefs: true
        backup: true
        validate: syslog-ng --syntax-only --cfgfile %s

    - name: Enable syslog-ng
      community.general.sysrc:
        name: syslog_ng_enable
        value: 'YES'

    - name: Start syslog-ng
      vbotka.freebsd.service:
        script: syslog-ng
        command: start

Playbook output - Configure, enable, and start Log Clients

(env) > ansible-playbook pb-logclient-conf.yml -i hosts -i iocage.ini -e debug=true
PLAY [Configure, enable, and start Log Clients.] *******************************

TASK [Display vars.] ***********************************************************
ok: [bar] => 
    msg: |-
        log_server: 10.10.99.118
        log_client: ['bar', 'foo']

TASK [Configure LOG_SERVER] ****************************************************
changed: [foo]
changed: [bar]

TASK [Enable syslog-ng] ********************************************************
changed: [bar]
changed: [foo]

TASK [Start syslog-ng] *********************************************************
changed: [foo]
changed: [bar]

PLAY RECAP *********************************************************************
bar                        : ok=4    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
foo                        : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Note

The configuration file /usr/local/etc/syslog-ng.conf, in the template ansible_syslogng_client, keeps the string LOG_SERVER in the place of the log-server IP. The above play replaces this string with the log-server IP.

List jails

shell > ssh admin@iocage_05 sudo iocage list -l
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+
| JID |    NAME    | BOOT | STATE | TYPE |   RELEASE    |         IP4          | IP6 |        TEMPLATE         | BASEJAIL |
+=====+============+======+=======+======+==============+======================+=====+=========================+==========+
| 20  | bar        | on   | up    | jail | 15.0-RELEASE | epair0b|10.10.99.193 | -   | ansible_syslogng_client | no       |
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+
| 19  | foo        | on   | up    | jail | 15.0-RELEASE | epair0b|10.10.99.122 | -   | ansible_syslogng_client | no       |
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+
| 18  | log-server | on   | up    | jail | 15.0-RELEASE | epair0b|10.10.99.118 | -   | ansible_syslogng_server | no       |
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+
| 13  | repos      | off  | up    | jail | 15.0-RELEASE | epair0b|10.10.99.134 | -   | ansible_pull_repos      | no       |
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+
| 12  | repos-dev  | off  | up    | jail | 15.0-RELEASE | epair0b|10.10.99.136 | -   | ansible_pull_repos      | no       |
+-----+------------+------+-------+------+--------------+----------------------+-----+-------------------------+----------+

Playbook pb-logserver-test.yml

---
- name: Test Log Server.
  hosts: log_server
    
  tasks:

    - name: Run commands.
      register: out
      ansible.builtin.shell: "{{ item }}"
      loop:
        - rm -rf /var/log/remote/localhost/*
        - service syslog-ng status
        - loggen -i -S -n 1 localhost 514
        - sleep 2; find /var/log/remote/localhost/ -name *.log | xargs cat

    - name: Debug.
      when: debug | d(false) | bool
      ansible.builtin.debug:
        msg: |
          {% for i in out.results %}
          shell> {{ i.item }}
          {% if i.stdout | length > 0 %}
          {{ i.stdout }}
          {% endif %}
          {% if i.stderr | length > 0 %}
          {{ i.stderr }}
          {% endif %}

          {% endfor %}

Playbook output - Test Log Server

(env) > ansible-playbook pb-logserver-test.yml -i hosts -e debug=true
PLAY [Test Log Server.] ********************************************************

TASK [Run commands.] ***********************************************************
changed: [log-server] => (item=rm -rf /var/log/remote/localhost/*)
changed: [log-server] => (item=service syslog-ng status)
changed: [log-server] => (item=loggen -i -S -n 1 localhost 514)
changed: [log-server] => (item=sleep 2; find /var/log/remote/localhost/ -name *.log | xargs cat)

TASK [Debug.] ******************************************************************
ok: [log-server] => 
    msg: |-
        shell> rm -rf /var/log/remote/localhost/*

        shell> service syslog-ng status
        syslog_ng is running as pid 48919.

        shell> loggen -i -S -n 1 localhost 514
        count=1, rate = 166666.67 msg/sec
        average rate = 2.00 msg/sec, count=1, time=0.500385, (average) msg size=256, bandwidth=0.50 kB/sec

        shell> sleep 2; find /var/log/remote/localhost/ -name *.log | xargs cat
        May 27 12:46:08 localhost prg00000[1234]: seq: 0000000000, thread: 0000, runid: 1779878768, stamp: 2026-05-27T12:46:08 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD

PLAY RECAP *********************************************************************
log-server                 : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Playbook pb-logclient-test.yml

---
- name: Test Log Clients.
  hosts: log_client

  vars:

    log_server: "{{ hostvars['log-server']['iocage_ip4'] }}"

  tasks:

    - name: Run loggen
      register: out
      ansible.builtin.command: "loggen -i -S -n 1 {{ log_server }} 514"

    - name: Debug.
      ansible.builtin.debug:
        var: out.stderr

- name: Display the logs.
  hosts: log_server
    
  tasks:

    - name: Get log files paths.
      register: out
      ansible.builtin.find:
        paths: /var/log/remote
        recurse: true
        patterns: '*.log'

    - name: Get log files.
      register: out
      ansible.builtin.command: "cat {{ item }}"
      loop: "{{ out.files | map(attribute='path') }}"

    - name: Display log files.
      ansible.builtin.debug:
        msg: |
          {{ item.stdout }}

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      loop: "{{ out.results }}"
      loop_control:
        label: "{{ item.cmd }}"

Playbook output - Test Log Clients

(env) > ansible-playbook pb-logclient-test.yml -i hosts
PLAY [Test Log Clients.] *******************************************************

TASK [Run loggen] **************************************************************
changed: [bar]
changed: [foo]

TASK [Debug.] ******************************************************************
ok: [bar] => 
    out.stderr: |-
        count=1, rate = 166666.67 msg/sec
        average rate = 2.00 msg/sec, count=1, time=0.500311, (average) msg size=256, bandwidth=0.50 kB/sec
ok: [foo] => 
    out.stderr: |-
        count=1, rate = 142857.14 msg/sec
        average rate = 2.00 msg/sec, count=1, time=0.500286, (average) msg size=256, bandwidth=0.50 kB/sec

PLAY [Display the logs.] *******************************************************

TASK [Get log files paths.] ****************************************************
ok: [log-server]

TASK [Get log files.] **********************************************************
changed: [log-server] => (item=/var/log/remote/ansible-syslogng-server/2026_05_27.log)
changed: [log-server] => (item=/var/log/remote/10.10.99.122/2026_05_27.log)
changed: [log-server] => (item=/var/log/remote/localhost/2026_05_27.log)
changed: [log-server] => (item=/var/log/remote/10.10.99.193/2026_05_27.log)

TASK [Display log files.] ******************************************************
ok: [log-server] => (item=['cat', '/var/log/remote/ansible-syslogng-server/2026_05_27.log']) => 
    msg: |-
        May 27 12:36:02 ansible-syslogng-server syslog-ng[46804]: syslog-ng starting up; version='4.11.0'
        May 27 12:36:03 ansible-syslogng-server syslog-ng[46804]: Error converting persistent state from on-disk format, losing file position information; filename='/var/log/ansible.log'
        May 27 12:36:03 ansible-syslogng-server syslog-ng[46804]: Loading the new configuration;
        May 27 12:36:03 ansible-syslogng-server syslog-ng[46804]: Configuration reload finished;
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.391473+02:00 ansible-syslogng-server dhclient 45056 - - receive_packet failed on epair0b: Device not configured
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.391671+02:00 ansible-syslogng-server dhclient 45056 - - ioctl(SIOCGIFFLAGS) on epair0b: Operation not permitted
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.391761+02:00 ansible-syslogng-server dhclient 45056 - - Interface epair0b no longer appears valid.
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.391855+02:00 ansible-syslogng-server dhclient 45056 - - No live interfaces to poll on - exiting.
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.391946+02:00 ansible-syslogng-server dhclient 45056 - - exiting.
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.392272+02:00 ansible-syslogng-server dhclient 45056 - - connection closed
        May 27 12:36:31 ansible-syslogng-server 1 2026-05-27T12:36:31.392369+02:00 ansible-syslogng-server dhclient 45056 - - exiting.
        May 27 12:36:31 ansible-syslogng-server syslog-ng[46804]: syslog-ng shutting down; version='4.11.0'

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ok: [log-server] => (item=['cat', '/var/log/remote/10.10.99.122/2026_05_27.log']) => 
    msg: |-
        May 27 12:45:24 10.10.99.122 syslog-ng[52092]: syslog-ng starting up; version='4.11.0'
        May 27 12:45:24 10.10.99.122 syslog-ng[52092]: Syslog connection established; fd='19', server='AF_INET(10.10.99.118:514)', local='AF_INET(0.0.0.0:0)'
        May 27 12:46:24 10.10.99.122 prg00000[1234]: seq: 0000000000, thread: 0000, runid: 1779878784, stamp: 2026-05-27T12:46:24 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD
        May 27 12:46:24 10.10.99.122 1 2026-05-27T12:46:24.816949+02:00 foo ansible-ansible.legacy.command 52656 - - Invoked with _raw_params=loggen -i -S -n 1 10.10.99.118 514 _uses_shell=False expand_argument_vars=True stdin_add_newline=True strip_empty_ends=True cmd=None argv=None chdir=None executable=None creates=None removes=None stdin=None

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ok: [log-server] => (item=['cat', '/var/log/remote/localhost/2026_05_27.log']) => 
    msg: |-
        May 27 12:46:08 localhost prg00000[1234]: seq: 0000000000, thread: 0000, runid: 1779878768, stamp: 2026-05-27T12:46:08 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ok: [log-server] => (item=['cat', '/var/log/remote/10.10.99.193/2026_05_27.log']) => 
    msg: |-
        May 27 12:45:24 10.10.99.193 syslog-ng[52143]: syslog-ng starting up; version='4.11.0'
        May 27 12:45:24 10.10.99.193 syslog-ng[52143]: Syslog connection established; fd='19', server='AF_INET(10.10.99.118:514)', local='AF_INET(0.0.0.0:0)'
        May 27 12:46:24 10.10.99.193 1 2026-05-27T12:46:24.756304+02:00 bar ansible-ansible.legacy.command 52654 - - Invoked with _raw_params=loggen -i -S -n 1 10.10.99.118 514 _uses_shell=False expand_argument_vars=True stdin_add_newline=True strip_empty_ends=True cmd=None argv=None chdir=None executable=None creates=None removes=None stdin=None
        May 27 12:46:24 10.10.99.193 prg00000[1234]: seq: 0000000000, thread: 0000, runid: 1779878784, stamp: 2026-05-27T12:46:24 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PLAY RECAP *********************************************************************
bar                        : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
foo                        : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
log-server                 : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Hint

Use the utility lnav on the log server to display all logfiles in the the directory /var/log/remote

shell > lnav -r /var/log/remote/