2018-09-10 11:33:08 +02:00
# FusionInventory
1. [Overview ](#overview )
2. [Role Variables ](#role-variables )
2020-03-12 08:35:29 +01:00
* [Config Specific Variables ](#config-specific-variables )
2018-09-10 11:33:08 +02:00
3. [Example Playbook ](#example-playbook )
4. [Configuration ](#configuration )
5. [Development ](#development )
6. [License ](#license )
7. [Author Information ](#author-information )
## Overview
A role to manage FusionInventory agent installation and configuration.
## Role Variables
2022-11-07 13:28:47 +01:00
* **fusioninventory__agent_version** : The version of Fusioninventory agent to install [default : `2.6-1` ].
2018-09-10 11:33:08 +02:00
* **fusioninventory__agent_depend_packages** : List of dependent packages to install.
2021-06-23 10:20:41 +02:00
* **fusioninventory__agent_recommend_packages** : List of recommended packages to install.
* **fusioninventory__agent_extra_packages** : List of extra packages to install (eg. to allow installation from a .deb file from Ansible).
2022-11-07 13:28:47 +01:00
* **fusioninventory__agent_package_url** : The URL used to download deb package for fusioninventory-agent [default : `"https://github.com/fusioninventory/fusioninventory-agent/releases/download/" + fusioninventory__agent_major_version + "/fusioninventory-agent_" + fusioninventory__agent_version + "_all.deb"` for Debian Stretch only].
2018-09-10 11:33:08 +02:00
* **fusioninventory__agent_deploy_state** : What is the desired state which this role should achieve [default : `present` ].
* **fusioninventory__agent_service_name** : The service name to manage [default : `fusioninventory-agent` ].
2021-08-27 16:39:45 +02:00
* **fusioninventory__agent_service_manage** : If the fusioninventory agent service should be managed [default : `true` ].
2018-09-10 14:02:41 +02:00
* **fusioninventory__agent_conf_src** : Template used to provide agent configuration file [default : `../templates/etc/fusioninventory/agent.cfg.j2` ].
2023-08-04 10:04:56 +02:00
* **fusioninventory__agent_service_status**: Service state, can be started, stopped, restarted, reloaded [default : `started` ].
* **fusioninventory__agent_service_enabled**: Service status, can be enabled (`true`) or disabled (`false`) [default: `true` ].
2018-09-10 11:33:08 +02:00
2023-08-07 10:48:51 +02:00
## Cron variables
* **fusioninventory__agent_conf_cron**: Enable (`"present"`) or disable (`"absent"`) a job cron to run the agent [default : `"absent"` ].
* **fusioninventory__agent_conf_cron_day**: Which days should the agent be ran [default : `"*"` ].
* **fusioninventory__agent_conf_cron_hour**: Which hours should the agent be ran [default : `"23"` ].
* **fusioninventory__agent_conf_cron_minute**: Which minutes should the agent be ran [default : `"0"` ].
* **fusioninventory__agent_conf_cron_month**: Which months should the agent be ran [default : `"*"` ].
* **fusioninventory__agent_conf_cron_weekday**: Which weekdays should the agent be ran [default : `"*"` ].
* **fusioninventory__agent_conf_cron_user**: Which user should the agent be ran under [default : `"root"` ].
* **fusioninventory__agent_conf_command**: The command should cron run [default : `"sleep $(( RANDOM \\% 3600 )); /usr/bin/fusioninventory-agent"` ].
2020-03-12 08:35:29 +01:00
### Config Specific Variables
Some variables used to generate FusionInventery agent.cfg file from Ansible template :
* **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⎵: ``].
2021-08-26 16:07:44 +02:00
* **fusioninventory__agent_conf_no_task** : Do not run given task (separated by a comma) [default⎵: ``].
2021-08-27 13:12:25 +02:00
* **fusioninventory__agent_conf_tasks** : Run given tasks in given order (separated by a comma) [default⎵: ``].
2020-03-12 08:35:29 +01:00
* **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⎵: ``].
2021-08-27 16:39:45 +02:00
* **fusioninventory__agent_conf_scan_homedirs** : Enable the scan of user home directories [default⎵: `false` ].
* **fusioninventory__agent_conf_scan_profiles** : Enable the scan of users list [default⎵: `false` ].
* **fusioninventory__agent_conf_no_ssl_check** : Disable check of the server SSL certificate [default⎵: `false` ].
* **fusioninventory__agent_conf_no_httpd** : Disable embedded web server [default⎵: `true` ].
2020-03-12 08:35:29 +01:00
* **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⎵: ``].
2021-08-27 13:26:36 +02:00
* **fusioninventory__agent_conf_log_logger** : Specifies the logger backend to use [default⎵: `syslog` ].
2021-08-27 13:42:43 +02:00
* **fusioninventory__agent_conf_log_facility** : Specifies the syslog facility to use for the syslog logger backend [default⎵: `LOG_DAEMON` ].
2021-08-27 15:17:46 +02:00
* **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` ].
2021-08-27 16:39:45 +02:00
* **fusioninventory__agent_conf_log_color** : Enables color display for the stderr logger backend [default⎵: `false` ].
2021-08-26 15:58:17 +02:00
* **fusioninventory__agent_conf_tag** : Add given tag to inventory results [default⎵: ``].
2021-08-27 16:39:45 +02:00
* **fusioninventory__agent_conf_debug** : If debug mode should be enabled [default⎵: `false` ].
2020-03-12 08:35:29 +01:00
2018-09-10 11:33:08 +02:00
## Example Playbook
* Use defaults vars :
``` yaml
- hosts: mynode.DOMAIN
roles:
- role: ipr-cnrs.fusioninventory
2020-03-12 08:35:29 +01:00
tags: ['role::fusioninventory', 'ipr', 'inventory']
2018-09-10 11:33:08 +02:00
```
2019-01-18 11:38:28 +01:00
* Install fusioninventory-agent from repository (unavailable in Debian Stretch and by default for all other release) :
2018-09-10 11:33:08 +02:00
``` yaml
- hosts: mynode.DOMAIN
roles:
- role: ipr-cnrs.fusioninventory
fusioninventory__agent_package_url: ''
tags: ['role::fusioninventory', 'ipr', inventory']
```
## Configuration
This role will :
* Install needed dependent packages of fusioninventory-agent.
2018-09-13 10:02:07 +02:00
* Once installed, the dependencies will not be removed.
2018-09-10 11:33:08 +02:00
* Install fusioninventory-agent package from official project package/URL.
2018-09-10 14:02:41 +02:00
* Generate agent's configuration file.
2018-09-10 14:55:42 +02:00
* Manage agent's systemd service.
2018-09-10 11:33:08 +02:00
## Development
This source code comes from our [Gogs instance][fusioninventory source] and the [Github repo][fusioninventory github] exist just to be able to send the role to Ansible Galaxy…
But feel free to send issue/PR here :)
Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][fusioninventory source] :)
## License
[WTFPL][wtfpl website]
## Author Information
Jérémy Gardais
* Source : [on IPR's Gogs][fusioninventory source]
* [IPR][ipr website] (Institut de Physique de Rennes)
[gogs to github hook]: https://stackoverflow.com/a/21998477
[fusioninventory source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.fusioninventory
[fusioninventory github]: https://github.com/ipr-cnrs/fusioninventory
[wtfpl website]: http://www.wtfpl.net/about/
[ipr website]: https://ipr.univ-rennes1.fr/