diff --git a/CHANGELOG.md b/CHANGELOG.md index df55a15..bbdea73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * **tag** with fusioninventory__agent_conf_tag variable * **no-task** with fusioninventory__agent_conf_no_task variable * **tasks** with fusioninventory__agent_conf_tasks variable + * **logger** with fusioninventory__agent_conf_log_logger variable ## v1.3.1 diff --git a/README.md b/README.md index 62fb590..58702a5 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Some variables used to generate FusionInventery agent.cfg file from Ansible temp * **fusioninventory__agent_conf_httpd_ip** : Interface/IP, the webserver server should listen to [default⎵: ``]. * **fusioninventory__agent_conf_httpd_port** : TCP port used by the webserver server to listen [default⎵: `62354`]. * **fusioninventory__agent_conf_httpd_trust** : hostname or IP or subnet authorized for http request [default⎵: ``]. +* **fusioninventory__agent_conf_log_logger** : Specifies the logger backend to use [default⎵: `syslog`]. * **fusioninventory__agent_conf_tag** : Add given tag to inventory results [default⎵: ``]. * **fusioninventory__agent_conf_debug** : If debug mode should be enabled [default⎵: `False`]. diff --git a/defaults/main.yml b/defaults/main.yml index d727ea5..4314eae 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -207,6 +207,21 @@ fusioninventory__agent_conf_httpd_port: '62354' # fusioninventory__agent_conf_httpd_trust: '' # ]]] +# .. envvar:: fusioninventory__agent_conf_log_logger: [[[ +# +# Specifies the logger backend to use. The possible values are: +# +# ``syslog`` +# Default. Log messages through the local syslog server. +# +# ``file`` +# Log messages in a file. +# +# ``stderr`` +# Log messages directly in the console. +# +fusioninventory__agent_conf_log_logger: 'syslog' + # ]]] # .. envvar:: fusioninventory__agent_conf_tag [[[ # # Add given tag to inventory results diff --git a/templates/etc/fusioninventory/agent.cfg.j2 b/templates/etc/fusioninventory/agent.cfg.j2 index 98676b9..4177bac 100644 --- a/templates/etc/fusioninventory/agent.cfg.j2 +++ b/templates/etc/fusioninventory/agent.cfg.j2 @@ -132,7 +132,7 @@ httpd-trust = {{ fusioninventory__agent_conf_httpd_trust }} # # Logger backend, either Stderr, File or Syslog (Stderr) -logger = syslog +logger = {{ fusioninventory__agent_conf_log_logger }} # log file #logfile = /var/log/fusioninventory.log # maximum log file size, in MB