From f89a1c4cf32b2cef40ff7e88b3c1d5021627f21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 27 Aug 2021 13:12:25 +0200 Subject: [PATCH] Manage tasks with fusioninventory__agent_conf_tasks var --- CHANGELOG.md | 1 + README.md | 1 + defaults/main.yml | 11 +++++++++++ templates/etc/fusioninventory/agent.cfg.j2 | 3 +++ 4 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ffeb4..df55a15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * 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 ## v1.3.1 diff --git a/README.md b/README.md index eb7cf3b..62fb590 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ 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`]. diff --git a/defaults/main.yml b/defaults/main.yml index 2d10f5e..d727ea5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -96,6 +96,17 @@ fusioninventory__agent_conf_local_dir: '' # 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 [[[ # diff --git a/templates/etc/fusioninventory/agent.cfg.j2 b/templates/etc/fusioninventory/agent.cfg.j2 index 9a2cccc..98676b9 100644 --- a/templates/etc/fusioninventory/agent.cfg.j2 +++ b/templates/etc/fusioninventory/agent.cfg.j2 @@ -33,6 +33,9 @@ local = {{ fusioninventory__agent_conf_local_dir }} 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