From ba252d04828658b5a18f2509b7a8ff3eb36fad09 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 2 Jan 2025 21:56:20 +0100 Subject: [PATCH] fix: user data ansible is loaded before --- src/rougail/output_ansible/config.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/rougail/output_ansible/config.py b/src/rougail/output_ansible/config.py index 617264c..682d3f2 100644 --- a/src/rougail/output_ansible/config.py +++ b/src/rougail/output_ansible/config.py @@ -23,7 +23,7 @@ def get_rougail_config( *, backward_compatibility=True, ) -> dict: - options = """ + options = [""" list: description: parameter added only to be compatible with Ansible negative_description: parameter added only to be compatible with Ansible @@ -44,12 +44,29 @@ json: disabled {% endif %} +""", """ +ansible: + exists: true + redefine: true + description: Configuration of user data or output Ansible + disabled: + type: jinja + jinja: | + {% if step.output != 'ansible' and 'ansible' not in step.user_data %} + disabled + {% endif %} + +""", """ ansible: description: Configuration of output Ansible + exists: false disabled: variable: step.output when_not: ansible +""", """ +ansible: + host_namespace: description: Namespace with host values default: "hosts" @@ -58,7 +75,7 @@ ansible: description: Only variables in hostname namespace is available by a host negative_description: All variables is available for all hosts default: false -""" +"""] return { "name": "ansible", "process": "output",