2
0
Fork 0

Compare commits

..

No commits in common. "master" and "v1.1.0" have entirely different histories.

12 changed files with 117 additions and 500 deletions

View File

@ -1,86 +1,3 @@
## 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 ## v1.1.0
### Features ### Features

View File

@ -1,8 +1,5 @@
# FusionInventory # 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) 1. [Overview](#overview)
2. [Role Variables](#role-variables) 2. [Role Variables](#role-variables)
* [Config Specific Variables](#config-specific-variables) * [Config Specific Variables](#config-specific-variables)
@ -18,28 +15,13 @@ A role to manage FusionInventory agent installation and configuration.
## Role Variables ## Role Variables
* **fusioninventory__agent_version**: The version of Fusioninventory agent to install [default: `2.6-1`]. * **fusioninventory__agent_version**: The version of Fusioninventory agent to install [default: `2.4-2`].
* **fusioninventory__agent_depend_packages**: List of dependent packages to install. * **fusioninventory__agent_depend_packages**: List of dependent packages to install.
* **fusioninventory__agent_recommend_packages**: List of recommended 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_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_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_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_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 ### Config Specific Variables
@ -47,24 +29,16 @@ 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_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_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_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_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_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_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_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_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_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_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_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_debug**: If debug mode should be enabled [default⎵: `False`].
* **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 ## Example Playbook

View File

@ -11,22 +11,9 @@
# #
# The version of Fusioninventory agent to install. # The version of Fusioninventory agent to install.
# #
fusioninventory__agent_version: '2.6-1' fusioninventory__agent_version: '2.4-2'
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 [[[ # .. envvar:: fusioninventory__agent_deploy_state [[[
# #
# What is the desired state which this role should achieve? Possible options: # What is the desired state which this role should achieve? Possible options:
@ -44,19 +31,6 @@ fusioninventory__agent_deploy_state: 'present'
# The service name to manage. # The service name to manage.
# #
fusioninventory__agent_service_name: 'fusioninventory-agent' 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 [[[ # .. envvar:: fusioninventory__agent_service_manage [[[
@ -69,69 +43,10 @@ fusioninventory__agent_service_enabled: true
# ``False`` # ``False``
# The service is disabled from startup. # 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 [[[ # Configuration [[[
# ----------------------------- # -----------------------------
@ -158,28 +73,6 @@ fusioninventory__agent_conf_server_url: ''
# #
fusioninventory__agent_conf_local_dir: '' 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 [[[ # .. envvar:: fusioninventory__agent_conf_delaytime [[[
# #
@ -193,9 +86,6 @@ fusioninventory__agent_conf_delaytime: '3600'
# Do not list given category items in inventory task. # Do not list given category items in inventory task.
# Should be a string with comma as a separator between categories. # Should be a string with comma as a separator between categories.
# #
# ``''``
# Default. Empty so all categories are listed.
#
fusioninventory__agent_conf_no_category: '' fusioninventory__agent_conf_no_category: ''
# ]]] # ]]]
@ -209,7 +99,7 @@ fusioninventory__agent_conf_no_category: ''
# ``True`` # ``True``
# The agent will scan homedirs. # The agent will scan homedirs.
# #
fusioninventory__agent_conf_scan_homedirs: false fusioninventory__agent_conf_scan_homedirs: False
# ]]] # ]]]
# .. envvar:: fusioninventory__agent_conf_scan_profiles [[[ # .. envvar:: fusioninventory__agent_conf_scan_profiles [[[
@ -222,7 +112,7 @@ fusioninventory__agent_conf_scan_homedirs: false
# ``True`` # ``True``
# The agent will scan user profile. # 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 [[[ # .. envvar:: fusioninventory__agent_conf_no_ssl_check [[[
@ -235,7 +125,7 @@ fusioninventory__agent_conf_scan_profiles: false
# ``True`` # ``True``
# The server's SSL certificate will not be checked. # 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 [[[ # .. envvar:: fusioninventory__agent_conf_no_httpd [[[
@ -248,7 +138,7 @@ fusioninventory__agent_conf_no_ssl_check: false
# ``False`` # ``False``
# The webserver will listen on the httpd-port (default to 62354). # 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: [[[ # .. envvar:: fusioninventory__agent_conf_httpd_ip: [[[
@ -279,79 +169,6 @@ fusioninventory__agent_conf_httpd_port: '62354'
# Default. # Default.
# #
fusioninventory__agent_conf_httpd_trust: '' 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 [[[ # .. envvar:: fusioninventory__agent_conf_debug [[[
# #
@ -364,7 +181,7 @@ fusioninventory__agent_conf_tag: ''
# Debug mode is enable and fusioninventory-agent will send informations # Debug mode is enable and fusioninventory-agent will send informations
# to journalctl/syslog/… # to journalctl/syslog/…
# #
fusioninventory__agent_conf_debug: false fusioninventory__agent_conf_debug: False
# ]]] # ]]]
# ]]] # ]]]

View File

@ -3,8 +3,6 @@
dependencies: [] dependencies: []
galaxy_info: galaxy_info:
role_name: fusioninventory
namespace: ipr-cnrs
author: "Jérémy Gardais" author: "Jérémy Gardais"
description: "Manage FusionInventory Agent" description: "Manage FusionInventory Agent"
license: WTFPL license: WTFPL
@ -14,15 +12,11 @@ galaxy_info:
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- bullseye
- buster
- stretch - stretch
- name: EL - name: EL
versions: versions:
- 8
- 7 - 7
galaxy_tags: galaxy_tags:
- agent - agent
- fusioninventory
- fusion - fusion
- inventory - inventory

View File

@ -3,35 +3,9 @@
# http://fusioninventory.org/documentation/agent/installation/linux/rhel.html # 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 - name: Add EPEL Repository
yum: yum_repository:
name: "{{ fusioninventory__repo_package }}" name: Epel
state: present description: EPEL YUM repo
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
- name: RedHat 8 specifics gpgkey: https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
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

View File

@ -4,47 +4,39 @@
# tasks file for fusioninventory # tasks file for fusioninventory
- name: Include package list per OS - name: Include package list per OS
include_vars: "{{ lookup('first_found', params) }}" include_vars: "{{ item }}"
vars: with_first_found:
params: - "{{ ansible_distribution }}.yml"
files: - "{{ ansible_os_family }}.yml"
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}.yml'
paths:
- 'vars'
# Manage fusioninventory related packages [[[1 # Manage dependent packages [[[1
- name: Ensure related packages are installed - name: Ensure dependent packages are installed
package: package:
name: '{{ (fusioninventory__agent_depend_packages|d([]) + name: '{{ item }}'
fusioninventory__agent_recommend_packages|d([]) +
fusioninventory__agent_extra_packages|d([]))
| flatten }}'
state: 'present' state: 'present'
with_flattened:
- '{{ fusioninventory__agent_depend_packages | to_nice_json }}'
register: pkg_dep_result register: pkg_dep_result
until: pkg_dep_result is success until: pkg_dep_result is success
when: ((fusioninventory__agent_package_url|length > 0) and when: fusioninventory__agent_deploy_state == "present"
(fusioninventory__agent_deploy_state == "present"))
# Manage agent package [[[1 # Manage agent package [[[1
# Specific tasks per OS will be in the include otherwise below # Specific tasks per OS will be in the include otherwise below
- name: Include tasks per OS - include: "{{ item }}"
include: "{{ lookup('first_found', params) }}" with_first_found:
vars: - "{{ ansible_distribution }}.yml"
params: - "{{ ansible_os_family }}.yml"
files:
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- name: Ensure fusioninventory-agent package from REPOS - name: Ensure fusioninventory-agent package from REPOS
package: package:
name: '{{ fusioninventory__agent_packages | flatten }}' name: '{{ fusioninventory__agent_packages }}'
state: '{{ "present" if (fusioninventory__agent_deploy_state == "present") state: '{{ "present" if (fusioninventory__agent_deploy_state == "present")
else "absent" }}' else "absent" }}'
register: pkg_agent_repo_result register: pkg_agent_repo_result
until: pkg_agent_repo_result is success until: pkg_agent_repo_result is success
when: fusioninventory__agent_package_url|length == 0 when: ((not fusioninventory__agent_package_url) or
(fusioninventory__agent_deploy_state == "absent"))
# Manage agent configuration file [[[1 # Manage agent configuration file [[[1
- name: Create Fusioninventory-agent configuration - name: Create Fusioninventory-agent configuration
@ -56,24 +48,3 @@
mode: '0644' mode: '0644'
when: fusioninventory__agent_deploy_state == "present" when: fusioninventory__agent_deploy_state == "present"
notify: ['restart fusioninventory-agent service'] 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 }}"

View File

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

View File

@ -1,10 +0,0 @@
---
# .. 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"

View File

@ -1,10 +0,0 @@
---
# .. 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"

View File

@ -1,42 +1,41 @@
--- ---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker # .. vim: foldmarker=[[[,]]]:foldmethod=marker
# .. envvar:: fusioninventory__agent_depend_packages # .. envvar:: fusioninventory__agent_depend_packages [[[
#
# List of dependent packages to install from a deb file # List of dependent packages to install.
fusioninventory__agent_depend_packages: fusioninventory__agent_depend_packages:
- 'dmidecode'
- 'hwdata' - 'hwdata'
- 'libfile-which-perl' - 'hdparm'
- 'libhttp-daemon-perl'
- 'libjson-pp-perl'
- 'libnet-cups-perl'
- 'libnet-ip-perl'
- 'libparse-edid-perl'
- 'libproc-daemon-perl'
- 'libsocket-getaddrinfo-perl'
- 'libtext-template-perl'
- 'libuniversal-require-perl' - 'libuniversal-require-perl'
- 'libwww-perl' - 'libwww-perl'
- 'libparse-edid-perl'
- 'libproc-daemon-perl'
- 'libfile-which-perl'
- 'libhttp-daemon-perl'
- 'libxml-treepp-perl' - 'libxml-treepp-perl'
- 'libxml-xpath-perl'
- 'libyaml-perl' - 'libyaml-perl'
- 'libyaml-tiny-perl' - 'libnet-cups-perl'
- 'libnet-ip-perl'
- 'libdigest-sha-perl'
- 'libjson-pp-perl'
- 'libsocket-getaddrinfo-perl'
- 'libtext-template-perl'
- 'lsb-base' - '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' - '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_packages:
- 'fusioninventory-agent' - 'fusioninventory-agent'

View File

@ -1,13 +0,0 @@
---
# .. 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"

View File

@ -1,15 +1,25 @@
--- ---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker # .. vim: foldmarker=[[[,]]]:foldmethod=marker
# .. envvar:: fusioninventory__agent_depend_packages # .. envvar:: fusioninventory__agent_depend_packages [[[
# #
# List of dependent packages to install. # List of dependent packages to install.
fusioninventory__agent_depend_packages: fusioninventory__agent_depend_packages:
- 'dmidecode' - '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_packages:
- 'fusioninventory-agent' - 'fusioninventory-agent'
- 'fusioninventory-agent-task-inventory' - '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 }}"