From 948079dafa8f15275db24e89d17afbada2a43c99 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 7 Nov 2021 16:18:51 -0600 Subject: [PATCH] r/samba-dc: Configure samba logging Send logs to the systemd journal for easier viewing and disable logging to a file. Also, the `samba_dc_log_level` variable can control the log level (0-10, 0 being off, 10 being insane debugging). --- roles/samba-dc/defaults/main.yml | 1 + roles/samba-dc/templates/smb.conf.j2 | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/roles/samba-dc/defaults/main.yml b/roles/samba-dc/defaults/main.yml index e9e8295..9795ea9 100644 --- a/roles/samba-dc/defaults/main.yml +++ b/roles/samba-dc/defaults/main.yml @@ -1,4 +1,5 @@ samba_dc_use_rfc2307: true samba_is_first_dc: false +samba_dc_log_level: 3 workgroup: '{{ krb5_realm.split(".")[0] if krb5_realm is defined else "WORKGROUP" }}' winbind_template_homedir: /home/%U diff --git a/roles/samba-dc/templates/smb.conf.j2 b/roles/samba-dc/templates/smb.conf.j2 index 315ea3f..b998db7 100644 --- a/roles/samba-dc/templates/smb.conf.j2 +++ b/roles/samba-dc/templates/smb.conf.j2 @@ -4,6 +4,11 @@ realm = {{ krb5_realm }} server role = active directory domain controller workgroup = {{ workgroup }} + + timestamp logs = no + logging = systemd file@0 + log level = {{ samba_dc_log_level }} + {% if samba_dc_use_rfc2307 %} idmap_ldb:use rfc2307 = yes {% endif %}