2
0
Fork 0

Compare commits

...

9 Commits

5 changed files with 162 additions and 36 deletions

View File

@ -1,3 +1,16 @@
## v1.4.0
### Add
* Manage new parameters:
* **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
* **logfacility** with fusioninventory__agent_conf_log_facility variable
* **logfile** with fusioninventory__agent_conf_log_file variable
* **logfile-maxsize** with fusioninventory__agent_conf_log_file_maxsize variable
* **color** with fusioninventory__agent_conf_log_color variable
## v1.3.1
### Fix

View File

@ -31,6 +31,8 @@ Some variables used to generate FusionInventery agent.cfg file from Ansible temp
* **fusioninventory__agent_conf_server_url**: The URL of your Fusioninventory-server/GLPI/… [default⎵: ``].
* **fusioninventory__agent_conf_local_dir**: Write tasks results in a directory [default⎵: ``].
* **fusioninventory__agent_conf_no_task**: Do not run given task (separated by a comma) [default⎵: ``].
* **fusioninventory__agent_conf_tasks**: Run given tasks in given order (separated by a comma) [default⎵: ``].
* **fusioninventory__agent_conf_delaytime**: Set an initial delay before the first target [default⎵: `3600`].
* **fusioninventory__agent_conf_no_category**: Do not list given category items in inventory task (separated by a comma) [default⎵: ``].
* **fusioninventory__agent_conf_scan_homedirs**: Enable the scan of user home directories [default⎵: `False`].
@ -40,6 +42,12 @@ 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_log_facility**: Specifies the syslog facility to use for the syslog logger backend [default⎵: `LOG_DAEMON`].
* **fusioninventory__agent_conf_log_file**: Specifies the file to use for the file logger backend [default⎵: `/var/log/fusioninventory.log`].
* **fusioninventory__agent_conf_log_file_maxsize**: Specifies the maximum size for the log file, in MB [default⎵: `0`].
* **fusioninventory__agent_conf_log_color**: Enables color display for the stderr logger backend [default⎵: `False`].
* **fusioninventory__agent_conf_tag**: Add given tag to inventory results [default⎵: ``].
* **fusioninventory__agent_conf_debug**: If debug mode should be enabled [default⎵: `False`].
## Example Playbook

View File

@ -85,6 +85,28 @@ fusioninventory__agent_conf_server_url: ''
#
fusioninventory__agent_conf_local_dir: ''
# ]]]
# .. envvar:: fusioninventory__agent_conf_no_task [[[
#
# Do not run given task.
# Should be a string with comma as a separator between tasks.
#
# ``''``
# Default. Empty so all tasks are runned.
#
fusioninventory__agent_conf_no_task: ''
# ]]]
# .. envvar:: fusioninventory__agent_conf_tasks [[[
#
# Run given tasks in given order.
# Should be a string with comma as a separator between tasks.
#
# ``''``
# Default. Empty so default order is applied.
#
fusioninventory__agent_conf_tasks: ''
# ]]]
# .. envvar:: fusioninventory__agent_conf_delaytime [[[
#
@ -98,6 +120,9 @@ fusioninventory__agent_conf_delaytime: '3600'
# Do not list given category items in inventory task.
# Should be a string with comma as a separator between categories.
#
# ``''``
# Default. Empty so all categories are listed.
#
fusioninventory__agent_conf_no_category: ''
# ]]]
@ -181,6 +206,79 @@ fusioninventory__agent_conf_httpd_port: '62354'
# Default.
#
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_log_facility: [[[
#
# Specifies the syslog facility to use for the syslog logger backend.
# The possible values are:
#
# ``LOG_DAEMON``
# Default. System daemons without separate facility value.
#
# ``LOG_USER``
# Generic user-level messages
#
# ``…``
# For all possible values, check syslog(3) manual.
#
fusioninventory__agent_conf_log_facility: 'LOG_DAEMON'
# ]]]
# .. envvar:: fusioninventory__agent_conf_log_file: [[[
#
# Specifies the file to use for the file logger backend.
#
# ``/var/log/fusioninventory.log``
# Default.
#
fusioninventory__agent_conf_log_file: '/var/log/fusioninventory.log'
# ]]]
# .. envvar:: fusioninventory__agent_conf_log_file_maxsize: [[[
#
# Specifies the maximum size for the log file, in MB.
# When the max size is reached, the file is truncated.
#
# ``0``
# Default. 0 means unlimited size.
#
fusioninventory__agent_conf_log_file_maxsize: '0'
# ]]]
# .. envvar:: fusioninventory__agent_conf_log_color [[[
#
# Enables color display for the stderr logger backend. Possible options:
#
# ``False``
# Default.
#
# ``True``
# Enable colors.
#
fusioninventory__agent_conf_log_color: False
# ]]]
# .. envvar:: fusioninventory__agent_conf_tag [[[
#
# Add given tag to inventory results
#
# ``''``
# Default. Empty so results are send without any tag.
#
fusioninventory__agent_conf_tag: ''
# ]]]
# .. envvar:: fusioninventory__agent_conf_debug [[[
#

View File

@ -4,6 +4,7 @@ dependencies: []
galaxy_info:
role_name: fusioninventory
namespace: ipr-cnrs
author: "Jérémy Gardais"
description: "Manage FusionInventory Agent"
license: WTFPL

View File

@ -1,15 +1,12 @@
# {{ ansible_managed }}
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
# fusioninventory agent configuration
# all defined values match default
# all commented values are examples
#
# Target definition options
#
# Target definition options [[[
# send tasks results to an OCS server
#server = http://server.domain.com/ocsinventory
# send tasks results to a FusionInventory for GLPI server
@ -23,27 +20,30 @@ server = {{ fusioninventory__agent_conf_server_url }}
local = {{ fusioninventory__agent_conf_local_dir }}
{% endif %}
#
# Task definition options
#
# ]]]
# Task definition options [[[
# disable software deployment tasks
#no-task = deploy
{% if fusioninventory__agent_conf_no_task %}
no-task = {{ fusioninventory__agent_conf_no_task }}
{% endif %}
#tasks = inventory,deploy,inventory
{% if fusioninventory__agent_conf_tasks %}
tasks = {{ fusioninventory__agent_conf_tasks }}
{% endif %}
#
# Target scheduling options
#
# ]]]
# Target scheduling options [[[
# maximum delay before first target, in seconds
delaytime = {{ fusioninventory__agent_conf_delaytime }}
# do not contact the target before next scheduled time
lazy = 0
#
# Inventory task specific options
#
# ]]]
# Inventory task specific options [[[
# do not list local printers
# no-category = printer
{% if fusioninventory__agent_conf_no_category %}
@ -72,17 +72,15 @@ force = 0
# additional inventory content file
additional-content =
#
# Package deployment task specific options
#
# ]]]
# Package deployment task specific options [[[
# do not use peer to peer to download files
no-p2p = 0
#
# Network options
#
# ]]]
# Network options [[[
# proxy address
proxy =
# user name for server authentication
@ -103,10 +101,9 @@ no-ssl-check = 0
# connection timeout, in seconds
timeout = 180
#
# Web interface options
#
# ]]]
# Web interface options [[[
{% if fusioninventory__agent_conf_no_httpd %}
# disable embedded web server
no-httpd = 1
@ -121,27 +118,34 @@ httpd-port = {{ fusioninventory__agent_conf_httpd_port }}
# trust requests without authentication token
httpd-trust = {{ fusioninventory__agent_conf_httpd_trust }}
#
# Logging options
#
# ]]]
# Logging options [[[
# Logger backend, either Stderr, File or Syslog (Stderr)
logger = syslog
logger = {{ fusioninventory__agent_conf_log_logger }}
{% if fusioninventory__agent_conf_log_logger == 'file' %}
# log file
#logfile = /var/log/fusioninventory.log
logfile = {{ fusioninventory__agent_conf_log_file }}
# maximum log file size, in MB
#logfile-maxsize = 0
logfile-maxsize = {{ fusioninventory__agent_conf_log_file_maxsize }}
{% endif %}
{% if fusioninventory__agent_conf_log_logger == 'syslog' %}
# Syslog facility
logfacility = LOG_DAEMON
# Use color in the console
logfacility = {{ fusioninventory__agent_conf_log_facility }}
{% endif %}
{% if fusioninventory__agent_conf_log_color %}
# Use color in the console with stderr backend
color = 1
{% else %}
# Don't use color in the console with stderr backend
color = 0
{% endif %}
#
# Execution mode options
#
# ]]]
# Execution mode options [[[
# add given tag to inventory results
tag =
tag = {{ fusioninventory__agent_conf_tag }}
{% if fusioninventory__agent_conf_debug %}
# enable debug mode
debug = 1
@ -151,7 +155,9 @@ debug = 0
{% endif %}
# time to wait to reload config (0 means no reload, it's default value)
# conf-reload-interval = 0
# conf-reload-interval = 0
# ]]]
# Since 2.4, you can include all .cfg files from a folder or any given file
# For example: