Compare commits
51 Commits
Author | SHA1 | Date |
---|---|---|
|
6e0b853749 | |
|
b5bdf41a76 | |
|
5f3078572c | |
|
c500fbc6d9 | |
|
014aa5fc62 | |
|
4b2442b4e9 | |
|
417f6fc58f | |
|
575004b092 | |
|
8c2bf15fe6 | |
|
8d2e46ebd2 | |
|
1919b0525f | |
|
368674c1ce | |
|
effce54f95 | |
|
cfc5e615e9 | |
|
24512eeea3 | |
|
4b425612f5 | |
|
2551c3bb9f | |
|
61644d90ca | |
|
89d8e1ea57 | |
|
76cfdf4df1 | |
|
74fbd8e653 | |
|
4ec60b99b3 | |
|
f89a1c4cf3 | |
|
068ded4376 | |
|
880b2cd427 | |
|
f40b672121 | |
|
12775009ae | |
|
dfad82144e | |
|
09b9c5bb26 | |
|
f7df94a728 | |
|
78b0528362 | |
|
2f30ef5954 | |
|
da8e53aac6 | |
|
b9f00ac858 | |
|
a9d3811432 | |
|
d80f5e5a2c | |
|
3153efe24b | |
|
3f36889b0b | |
|
26a152e9fb | |
|
f3be491216 | |
|
53f622acaf | |
|
85010486a3 | |
|
0f0be2616c | |
|
2bb3055502 | |
|
cb5929938d | |
|
2722fc9613 | |
|
d4eb45dc03 | |
|
2099697579 | |
|
82badc3140 | |
|
3103604379 | |
|
ab1e1ca2b4 |
83
CHANGELOG.md
83
CHANGELOG.md
|
@ -1,3 +1,86 @@
|
|||
## v1.5.0
|
||||
|
||||
### Enhancement
|
||||
* Upgrade package version from URL from 2.4 to 2.6 (thanks to @roumano - issue #15).
|
||||
* Allow running the agent with a cron job instead of the service (thanks to @yodabzh - issue #18)
|
||||
* Allow service to be managed, (thanks to @yodabzh - issue #17).
|
||||
|
||||
### Fix
|
||||
* Switch to Github URL to download deb file (thanks to @roumano - PR #16).
|
||||
* Pipe ansible_managed to `comment` jinja filter to manage multi-lines.
|
||||
|
||||
## v1.4.1
|
||||
|
||||
### Fix
|
||||
* truthy warnings with ansible-lint.
|
||||
* complete rhel8 support (thanks @mjourdan − PR #13).
|
||||
|
||||
## 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
|
||||
|
||||
* Update package list for Debian from `dpkg --info` of the last 2.6 version (fix #11).
|
||||
|
||||
### Enhancement
|
||||
|
||||
* Flatten packages list to allow condition.
|
||||
* Split fusioninventory__agent_depend_packages content to 3 variables (for Debian)
|
||||
* fusioninventory__agent_depend_packages
|
||||
* fusioninventory__agent_recommend_packages
|
||||
* fusioninventory__agent_extra_packages
|
||||
* Manage dependencies only when FI is installed from a downloaded package.
|
||||
|
||||
## v1.3.0
|
||||
|
||||
### Fix
|
||||
|
||||
* Add role_name info in meta.
|
||||
* Set a default mode (0644) in ini_file.
|
||||
* with_first_found fail when ansible_distribution vars file is missing (#5).
|
||||
|
||||
### Enhancement
|
||||
|
||||
* Update dependencies for .deb package.
|
||||
|
||||
## v1.2.1
|
||||
|
||||
### Fix
|
||||
|
||||
* Warnings with yamllint.
|
||||
|
||||
## v1.2.0
|
||||
|
||||
### Features
|
||||
|
||||
* Add RHEL8 support (thanks @mjourdan) (#7).
|
||||
* The role also works on Debian Bullseye.
|
||||
|
||||
## v1.1.2
|
||||
|
||||
* Add missing dependencies (libyaml-tiny-perl, libxml-treepp-perl and ucf).
|
||||
* The role also works on Debian Buster.
|
||||
|
||||
## v1.1.1
|
||||
|
||||
### Fix
|
||||
|
||||
* Moved back fusioninventory__agent_package_url definition in default configuration
|
||||
even if it's Debian related to allow installation of a newer version than one
|
||||
available in repos or installation from private repository (for Stretch).
|
||||
|
||||
## v1.1.0
|
||||
|
||||
### Features
|
||||
|
|
42
README.md
42
README.md
|
@ -1,5 +1,8 @@
|
|||
# FusionInventory
|
||||
|
||||
As [fusioninventory-agent is no longer maintened](https://github.com/ipr-cnrs/fusioninventory/issues/12#issuecomment-937656377),
|
||||
you should consider using the "new" [glpi-agent role](https://github.com/ipr-cnrs/glpi-agent).
|
||||
|
||||
1. [Overview](#overview)
|
||||
2. [Role Variables](#role-variables)
|
||||
* [Config Specific Variables](#config-specific-variables)
|
||||
|
@ -15,13 +18,28 @@ A role to manage FusionInventory agent installation and configuration.
|
|||
|
||||
## Role Variables
|
||||
|
||||
* **fusioninventory__agent_version** : The version of Fusioninventory agent to install [default : `2.4-2`].
|
||||
* **fusioninventory__agent_version** : The version of Fusioninventory agent to install [default : `2.6-1`].
|
||||
* **fusioninventory__agent_depend_packages** : List of dependent packages to install.
|
||||
* **fusioninventory__agent_package_url** : The URL used to download deb package for fusioninventory-agent [default : `http://debian.fusioninventory.org/downloads/fusioninventory-agent_{{ fusioninventory__agent_version }}_all.deb` for Debian Stretch only].
|
||||
* **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).
|
||||
* **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].
|
||||
* **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`].
|
||||
* **fusioninventory__agent_service_manage** : If the fusioninventory agent service should be managed [default : `True`].
|
||||
* **fusioninventory__agent_service_manage** : If the fusioninventory agent service should be managed [default : `true`].
|
||||
* **fusioninventory__agent_conf_src** : Template used to provide agent configuration file [default : `../templates/etc/fusioninventory/agent.cfg.j2`].
|
||||
* **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`].
|
||||
|
||||
## 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"`].
|
||||
|
||||
### Config Specific Variables
|
||||
|
||||
|
@ -29,16 +47,24 @@ 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`].
|
||||
* **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`].
|
||||
* **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`].
|
||||
* **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_debug** : If debug mode should be enabled [default⎵: `False`].
|
||||
* **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
|
||||
|
||||
|
|
|
@ -11,9 +11,22 @@
|
|||
#
|
||||
# The version of Fusioninventory agent to install.
|
||||
#
|
||||
fusioninventory__agent_version: '2.4-2'
|
||||
fusioninventory__agent_version: '2.6-1'
|
||||
fusioninventory__agent_major_version: '2.6'
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_package_url [[[
|
||||
#
|
||||
# The URL used to download deb package for fusioninventory-agent.
|
||||
#
|
||||
# See the official documentation for more informations :
|
||||
# http://fusioninventory.org/documentation/agent/installation/linux/deb.html
|
||||
#
|
||||
# Only works with Debian
|
||||
fusioninventory__agent_package_url: '{{ "https://github.com/fusioninventory/fusioninventory-agent/releases/download/" + fusioninventory__agent_major_version + "/fusioninventory-agent_" + fusioninventory__agent_version + "_all.deb"
|
||||
if (ansible_distribution_release in
|
||||
([ "stretch" ]))
|
||||
else "" }}'
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_deploy_state [[[
|
||||
#
|
||||
# What is the desired state which this role should achieve ? Possible options :
|
||||
|
@ -31,6 +44,19 @@ fusioninventory__agent_deploy_state: 'present'
|
|||
# The service name to manage.
|
||||
#
|
||||
fusioninventory__agent_service_name: 'fusioninventory-agent'
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_service_status [[[
|
||||
#
|
||||
# The targeted service status.
|
||||
#
|
||||
fusioninventory__agent_service_status: 'started'
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_service_enabled [[[
|
||||
#
|
||||
# The targeted service status.
|
||||
#
|
||||
fusioninventory__agent_service_enabled: true
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_service_manage [[[
|
||||
|
@ -43,10 +69,69 @@ fusioninventory__agent_service_name: 'fusioninventory-agent'
|
|||
# ``False``
|
||||
# The service is disabled from startup.
|
||||
#
|
||||
fusioninventory__agent_service_manage: True
|
||||
fusioninventory__agent_service_manage: true
|
||||
|
||||
# ]]]
|
||||
|
||||
# Cron configuration [[[
|
||||
# -----------------------------
|
||||
# .. envvar:: fusioninventory__agent_conf_cron [[[
|
||||
#
|
||||
# Instead of running as an agent, run by cron. Can be "absent" or "present"
|
||||
#
|
||||
fusioninventory__agent_conf_cron: "absent"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_day [[[
|
||||
#
|
||||
# Which days should the agent be ran
|
||||
#
|
||||
fusioninventory__agent_conf_cron_day: "*"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_hour [[[
|
||||
#
|
||||
# Which hours should the agent be ran
|
||||
#
|
||||
fusioninventory__agent_conf_cron_hour: "23"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_minute [[[
|
||||
#
|
||||
# Which minutes should the agent be ran
|
||||
#
|
||||
fusioninventory__agent_conf_cron_minute: "0"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_month [[[
|
||||
#
|
||||
# Which months should the agent be ran
|
||||
#
|
||||
fusioninventory__agent_conf_cron_month: "*"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_weekday [[[
|
||||
#
|
||||
# Which weekdays should the agent be ran
|
||||
#
|
||||
fusioninventory__agent_conf_cron_weekday: "*"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_cron_user [[[
|
||||
#
|
||||
# Which user should the agent be ran under
|
||||
#
|
||||
fusioninventory__agent_conf_cron_user: "root"
|
||||
# ]]]
|
||||
|
||||
# .. envvar:: fusioninventory__agent_conf_command [[[
|
||||
#
|
||||
# The command should cron run
|
||||
#
|
||||
fusioninventory__agent_conf_command: "sleep $(( RANDOM \\% 3600 )); /usr/bin/fusioninventory-agent"
|
||||
# ]]]
|
||||
# ]]]
|
||||
|
||||
# Configuration [[[
|
||||
# -----------------------------
|
||||
|
||||
|
@ -73,6 +158,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 [[[
|
||||
#
|
||||
|
@ -86,6 +193,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: ''
|
||||
|
||||
# ]]]
|
||||
|
@ -99,7 +209,7 @@ fusioninventory__agent_conf_no_category: ''
|
|||
# ``True``
|
||||
# The agent will scan homedirs.
|
||||
#
|
||||
fusioninventory__agent_conf_scan_homedirs: False
|
||||
fusioninventory__agent_conf_scan_homedirs: false
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_conf_scan_profiles [[[
|
||||
|
@ -112,7 +222,7 @@ fusioninventory__agent_conf_scan_homedirs: False
|
|||
# ``True``
|
||||
# The agent will scan user profile.
|
||||
#
|
||||
fusioninventory__agent_conf_scan_profiles: False
|
||||
fusioninventory__agent_conf_scan_profiles: false
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_conf_no_ssl_check [[[
|
||||
|
@ -125,7 +235,7 @@ fusioninventory__agent_conf_scan_profiles: False
|
|||
# ``True``
|
||||
# The server's SSL certificate will not be checked.
|
||||
#
|
||||
fusioninventory__agent_conf_no_ssl_check: False
|
||||
fusioninventory__agent_conf_no_ssl_check: false
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_conf_no_httpd [[[
|
||||
|
@ -138,7 +248,7 @@ fusioninventory__agent_conf_no_ssl_check: False
|
|||
# ``False``
|
||||
# The webserver will listen on the httpd-port (default to 62354).
|
||||
#
|
||||
fusioninventory__agent_conf_no_httpd: True
|
||||
fusioninventory__agent_conf_no_httpd: true
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_conf_httpd_ip: [[[
|
||||
|
@ -169,6 +279,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 [[[
|
||||
#
|
||||
|
@ -181,7 +364,7 @@ fusioninventory__agent_conf_httpd_trust: ''
|
|||
# Debug mode is enable and fusioninventory-agent will send informations
|
||||
# to journalctl/syslog/…
|
||||
#
|
||||
fusioninventory__agent_conf_debug: False
|
||||
fusioninventory__agent_conf_debug: false
|
||||
|
||||
# ]]]
|
||||
# ]]]
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
role_name: fusioninventory
|
||||
namespace: ipr-cnrs
|
||||
author: "Jérémy Gardais"
|
||||
description: "Manage FusionInventory Agent"
|
||||
license: WTFPL
|
||||
|
@ -12,11 +14,15 @@ galaxy_info:
|
|||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- bullseye
|
||||
- buster
|
||||
- stretch
|
||||
- name: EL
|
||||
versions:
|
||||
- 8
|
||||
- 7
|
||||
galaxy_tags:
|
||||
- agent
|
||||
- fusioninventory
|
||||
- fusion
|
||||
- inventory
|
||||
|
|
|
@ -3,9 +3,35 @@
|
|||
|
||||
# http://fusioninventory.org/documentation/agent/installation/linux/rhel.html
|
||||
|
||||
- name: Import EPEL GPG key
|
||||
rpm_key:
|
||||
key: "{{ fusioninventory__repo_gpgkey }}"
|
||||
state: present
|
||||
|
||||
- name: Add EPEL Repository
|
||||
yum_repository:
|
||||
name: Epel
|
||||
description: EPEL YUM repo
|
||||
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
|
||||
gpgkey: https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
|
||||
yum:
|
||||
name: "{{ fusioninventory__repo_package }}"
|
||||
state: present
|
||||
|
||||
- name: RedHat 8 specifics
|
||||
block:
|
||||
|
||||
- name: Load additional repository settings for CentOS or RedHat 8
|
||||
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
|
||||
- name: Override repository settings for CentOS <= 8.2
|
||||
include_vars: "CentOS-8.2.yml"
|
||||
when:
|
||||
- ansible_facts['distribution'] == "CentOS"
|
||||
- ansible_facts['distribution_version'] | float <= 8.2
|
||||
|
||||
- name: Enable Additional Repository
|
||||
ini_file:
|
||||
path: "{{ fusioninventory__additional_repo_file }}"
|
||||
section: "{{ item.section }}"
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
mode: "0644"
|
||||
loop: "{{ fusioninventory__additional_repo_params }}"
|
||||
|
||||
when: ansible_facts['distribution_major_version'] | int >= 8
|
||||
|
|
|
@ -4,39 +4,47 @@
|
|||
# tasks file for fusioninventory
|
||||
|
||||
- name: Include package list per OS
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}.yml"
|
||||
include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
paths:
|
||||
- 'vars'
|
||||
|
||||
# Manage dependent packages [[[1
|
||||
- name: Ensure dependent packages are installed
|
||||
# Manage fusioninventory related packages [[[1
|
||||
- name: Ensure related packages are installed
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
name: '{{ (fusioninventory__agent_depend_packages|d([]) +
|
||||
fusioninventory__agent_recommend_packages|d([]) +
|
||||
fusioninventory__agent_extra_packages|d([]))
|
||||
| flatten }}'
|
||||
state: 'present'
|
||||
with_flattened:
|
||||
- '{{ fusioninventory__agent_depend_packages | to_nice_json }}'
|
||||
register: pkg_dep_result
|
||||
until: pkg_dep_result is success
|
||||
when: fusioninventory__agent_deploy_state == "present"
|
||||
when: ((fusioninventory__agent_package_url|length > 0) and
|
||||
(fusioninventory__agent_deploy_state == "present"))
|
||||
|
||||
# Manage agent package [[[1
|
||||
|
||||
# Specific tasks per OS will be in the include otherwise below
|
||||
- include: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}.yml"
|
||||
- name: Include tasks per OS
|
||||
include: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
|
||||
- name: Ensure fusioninventory-agent package from REPOS
|
||||
package:
|
||||
name: '{{ fusioninventory__agent_packages }}'
|
||||
name: '{{ fusioninventory__agent_packages | flatten }}'
|
||||
state: '{{ "present" if (fusioninventory__agent_deploy_state == "present")
|
||||
else "absent" }}'
|
||||
register: pkg_agent_repo_result
|
||||
until: pkg_agent_repo_result is success
|
||||
when: ((not fusioninventory__agent_package_url) or
|
||||
(fusioninventory__agent_deploy_state == "absent"))
|
||||
when: fusioninventory__agent_package_url|length == 0
|
||||
|
||||
# Manage agent configuration file [[[1
|
||||
- name: Create Fusioninventory-agent configuration
|
||||
|
@ -48,3 +56,24 @@
|
|||
mode: '0644'
|
||||
when: fusioninventory__agent_deploy_state == "present"
|
||||
notify: ['restart fusioninventory-agent service']
|
||||
|
||||
- name: Ensure the service is in the correct state
|
||||
service:
|
||||
name: "{{ fusioninventory__agent_service_name }}"
|
||||
state: "{{ fusioninventory__agent_service_status }}"
|
||||
enabled: "{{ fusioninventory__agent_service_enabled }}"
|
||||
when: fusioninventory__agent_deploy_state == "present"
|
||||
|
||||
- name: "Create cron entry when needed"
|
||||
cron:
|
||||
name: fusion-inventory-oneshot
|
||||
cron_file: fusion-inventory-oneshot
|
||||
day: "{{ fusioninventory__agent_conf_cron_day }}"
|
||||
hour: "{{ fusioninventory__agent_conf_cron_hour }}"
|
||||
minute: "{{ fusioninventory__agent_conf_cron_minute }}"
|
||||
month: "{{ fusioninventory__agent_conf_cron_month }}"
|
||||
weekday: "{{ fusioninventory__agent_conf_cron_weekday }}"
|
||||
user: "{{ fusioninventory__agent_conf_cron_user }}"
|
||||
state: "{{ fusioninventory__agent_conf_cron }}"
|
||||
job: "{{ fusioninventory__agent_conf_command }}"
|
||||
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
# {{ ansible_managed }}
|
||||
# {{ ansible_managed | comment }}
|
||||
# .. 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:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# For CentOS Linux 8.2 and below
|
||||
# https://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.2011#Yum_repo_file_and_repoid_changes
|
||||
fusioninventory__additional_repo_file: "/etc/yum.repos.d/{{ ansible_distribution }}-PowerTools.repo"
|
||||
fusioninventory__additional_repo_params:
|
||||
- section: PowerTools
|
||||
option: enabled
|
||||
value: "1"
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# For CentOS Linux 8.3 and above
|
||||
# https://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.2011#Yum_repo_file_and_repoid_changes
|
||||
fusioninventory__additional_repo_file: "/etc/yum.repos.d/{{ ansible_distribution }}-Linux-PowerTools.repo"
|
||||
fusioninventory__additional_repo_params:
|
||||
- section: powertools
|
||||
option: enabled
|
||||
value: "1"
|
|
@ -1,41 +1,42 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# .. envvar:: fusioninventory__agent_depend_packages [[[
|
||||
#
|
||||
# List of dependent packages to install.
|
||||
# .. envvar:: fusioninventory__agent_depend_packages
|
||||
|
||||
# List of dependent packages to install from a deb file
|
||||
fusioninventory__agent_depend_packages:
|
||||
- 'dmidecode'
|
||||
- 'hwdata'
|
||||
- 'hdparm'
|
||||
- 'libuniversal-require-perl'
|
||||
- 'libwww-perl'
|
||||
- 'libparse-edid-perl'
|
||||
- 'libproc-daemon-perl'
|
||||
- 'libfile-which-perl'
|
||||
- 'libhttp-daemon-perl'
|
||||
- 'libxml-treepp-perl'
|
||||
- 'libyaml-perl'
|
||||
- 'libjson-pp-perl'
|
||||
- 'libnet-cups-perl'
|
||||
- 'libnet-ip-perl'
|
||||
- 'libdigest-sha-perl'
|
||||
- 'libjson-pp-perl'
|
||||
- 'libparse-edid-perl'
|
||||
- 'libproc-daemon-perl'
|
||||
- 'libsocket-getaddrinfo-perl'
|
||||
- 'libtext-template-perl'
|
||||
- 'libuniversal-require-perl'
|
||||
- 'libwww-perl'
|
||||
- 'libxml-treepp-perl'
|
||||
- 'libxml-xpath-perl'
|
||||
- 'libyaml-perl'
|
||||
- 'libyaml-tiny-perl'
|
||||
- 'lsb-base'
|
||||
- 'ucf'
|
||||
|
||||
# List of recommended packages to install from a deb file
|
||||
fusioninventory__agent_recommend_packages:
|
||||
- 'dmidecode'
|
||||
- '{{ "util-linux"
|
||||
if ansible_distribution_release in
|
||||
[ "stretch" ]
|
||||
else "fdisk" }}'
|
||||
- 'hdparm'
|
||||
- 'libio-socket-ssl-perl'
|
||||
|
||||
# List of packages to be able install a deb file with Ansible
|
||||
fusioninventory__agent_extra_packages:
|
||||
- 'xz-utils'
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_package_url [[[
|
||||
#
|
||||
# The URL used to download deb package for fusioninventory-agent.
|
||||
#
|
||||
# See the official documentation for more informations :
|
||||
# http://fusioninventory.org/documentation/agent/installation/linux/deb.html
|
||||
#
|
||||
fusioninventory__agent_package_url: '{{ "http://debian.fusioninventory.org/downloads/fusioninventory-agent_"+ fusioninventory__agent_version + "_all.deb"
|
||||
if (ansible_distribution_release in
|
||||
([ "stretch" ]))
|
||||
else "" }}'
|
||||
# ]]]
|
||||
|
||||
fusioninventory__agent_packages:
|
||||
- 'fusioninventory-agent'
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# For RedHat Entreprise Linux 8
|
||||
# https://developers.redhat.com/blog/2018/11/15/introducing-codeready-linux-builder/
|
||||
fusioninventory__additional_repo_file: "/etc/yum.repos.d/redhat.repo"
|
||||
fusioninventory__additional_repo_params:
|
||||
- section: codeready-builder-for-rhel-8-x86_64-rpms
|
||||
option: enabled
|
||||
value: "1"
|
||||
- section: rhel-8-for-x86_64-appstream-rpms
|
||||
option: enabled
|
||||
value: "1"
|
|
@ -1,25 +1,15 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# .. envvar:: fusioninventory__agent_depend_packages [[[
|
||||
# .. envvar:: fusioninventory__agent_depend_packages
|
||||
#
|
||||
# List of dependent packages to install.
|
||||
fusioninventory__agent_depend_packages:
|
||||
- 'dmidecode'
|
||||
# ]]]
|
||||
# .. envvar:: fusioninventory__agent_package_url [[[
|
||||
#
|
||||
# The URL used to download deb package for fusioninventory-agent.
|
||||
#
|
||||
# See the official documentation for more informations :
|
||||
# http://fusioninventory.org/documentation/agent/installation/linux/deb.html
|
||||
#
|
||||
fusioninventory__agent_package_url: '{{ "http://debian.fusioninventory.org/downloads/fusioninventory-agent_"+ fusioninventory__agent_version + "_all.deb"
|
||||
if (ansible_distribution_release in
|
||||
([ "stretch" ]))
|
||||
else "" }}'
|
||||
# ]]]
|
||||
|
||||
fusioninventory__agent_packages:
|
||||
- 'fusioninventory-agent'
|
||||
- 'fusioninventory-agent-task-inventory'
|
||||
|
||||
fusioninventory__repo_package: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
|
||||
fusioninventory__repo_gpgkey: "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
|
||||
|
|
Reference in New Issue