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