From f7df94a728b497e5f36d349247dd42b3bf4c1b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 23 Jun 2021 10:20:41 +0200 Subject: [PATCH] Split depend_packages content to 3 vars --- CHANGELOG.md | 4 ++++ README.md | 2 ++ tasks/main.yml | 10 ++++++---- vars/Debian.yml | 12 +++++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34c80c..b1d4d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ### 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 ## v1.3.0 diff --git a/README.md b/README.md index 295d998..d0d1cf2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ A role to manage FusionInventory agent installation and configuration. * **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_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 : `http://debian.fusioninventory.org/downloads/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`]. diff --git a/tasks/main.yml b/tasks/main.yml index 76a6b95..cbee0bb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,11 +13,13 @@ 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: '{{ fusioninventory__agent_depend_packages | flatten }}' + name: '{{ (fusioninventory__agent_depend_packages|d([]) + + fusioninventory__agent_recommend_packages|d([]) + + fusioninventory__agent_extra_packages|d([])) + | flatten }}' state: 'present' register: pkg_dep_result until: pkg_dep_result is success diff --git a/vars/Debian.yml b/vars/Debian.yml index 14bf8f0..149fff3 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -2,10 +2,9 @@ # .. vim: foldmarker=[[[,]]]:foldmethod=marker # .. envvar:: fusioninventory__agent_depend_packages -# -# List of dependent packages to install. + +# List of dependent packages to install from a deb file fusioninventory__agent_depend_packages: - - 'dmidecode' - 'fusioninventory-agent' - 'hdparm' - 'hwdata' @@ -29,6 +28,13 @@ fusioninventory__agent_depend_packages: - 'ucf' - 'usbutils' - 'usb.ids' + +# List of recommended packages to install from a deb file +fusioninventory__agent_recommend_packages: + - 'dmidecode' + +# List of packages to be able install a deb file with Ansible +fusioninventory__agent_extra_packages: - 'xz-utils' fusioninventory__agent_packages: