[TIDY] Move to ansible_facts dict instead of injected variables

This commit is contained in:
Jannik Beyerstedt 2025-12-20 21:08:31 +01:00
parent d1c6d34a64
commit 1c734cefb1
15 changed files with 39 additions and 39 deletions

View file

@ -18,7 +18,7 @@ LogLevel INFO
# Authentication:
#LoginGraceTime 2m
{% if 'root' == ansible_user_id %}
{% if 'root' == ansible_facts['user_id'] %}
PermitRootLogin yes
{% else %}
PermitRootLogin no
@ -64,9 +64,9 @@ UseDNS no
AcceptEnv LANG LC_*
# Log sftp level file access (read/write/etc.) that would not be easily logged otherwise.
{% if ((override_os_family is defined) | ternary(override_os_family,ansible_os_family)) == 'Centos' %}
{% if ((override_os_family is defined) | ternary(override_os_family,ansible_facts['os_family'])) == 'Centos' %}
Subsystem sftp /usr/libexec/openssh/sftp-server -f AUTHPRIV -l INFO
{% elif ((override_os_family is defined) | ternary(override_os_family,ansible_os_family)) == 'FreeBSD' %}
{% elif ((override_os_family is defined) | ternary(override_os_family,ansible_facts['os_family'])) == 'FreeBSD' %}
Subsystem sftp /usr/libexec/sftp-server
{% else %}
Subsystem sftp /usr/lib/openssh/sftp-server -f AUTHPRIV -l INFO

View file

@ -75,7 +75,7 @@
# ## If true, a field name like 'temp1_input' will be changed to 'temp_input'.
# # remove_numbers = true
{% if ansible_lsb.id is defined and ansible_lsb.id == "Raspbian" %}
{% if ansible_facts['lsb']['id'] is defined and ansible_facts['lsb']['id'] == "Raspbian" %}
# On Raspbian, get CPU temperature (in millicelsius)
[[inputs.exec]]
commands = ["cat /sys/class/thermal/thermal_zone0/temp"]