diff --git a/src/rougail/output_ansible/__init__.py b/src/rougail/output_ansible/__init__.py index e8e916d..5bbed20 100644 --- a/src/rougail/output_ansible/__init__.py +++ b/src/rougail/output_ansible/__init__.py @@ -1,6 +1,6 @@ """ Silique (https://www.silique.fr) -Copyright (C) 2022-2024 +Copyright (C) 2022-2025 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -48,6 +48,8 @@ class RougailOutputAnsible(RougailOutputJson): def exporter(self) -> None: super().exporter() self.json_to_ansible() + # never return code 1, error are in the output data + return True def manage_errors(self) -> bool: if not super().manage_errors(): diff --git a/src/rougail/output_ansible/config.py b/src/rougail/output_ansible/config.py index 682d3f2..92ae530 100644 --- a/src/rougail/output_ansible/config.py +++ b/src/rougail/output_ansible/config.py @@ -1,6 +1,6 @@ """ Silique (https://www.silique.fr) -Copyright (C) 2024 +Copyright (C) 2024-2025 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/src/rougail/output_ansible/i18n.py b/src/rougail/output_ansible/i18n.py index 78393c0..b514e77 100644 --- a/src/rougail/output_ansible/i18n.py +++ b/src/rougail/output_ansible/i18n.py @@ -1,6 +1,6 @@ """Internationalisation utilities Silique (https://www.silique.fr) -Copyright (C) 2024 +Copyright (C) 2024-2025 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/tests/results/test_namespace/00_6secret.json b/tests/results/test_namespace/00_6secret.json new file mode 100644 index 0000000..2092488 --- /dev/null +++ b/tests/results/test_namespace/00_6secret.json @@ -0,0 +1,42 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/04_5disabled_calculation_multi.json b/tests/results/test_namespace/04_5disabled_calculation_multi.json new file mode 100644 index 0000000..584a2ae --- /dev/null +++ b/tests/results/test_namespace/04_5disabled_calculation_multi.json @@ -0,0 +1,60 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/04_5disabled_calculation_variable_multi.json b/tests/results/test_namespace/04_5disabled_calculation_variable_multi.json new file mode 100644 index 0000000..7f98eb8 --- /dev/null +++ b/tests/results/test_namespace/04_5disabled_calculation_variable_multi.json @@ -0,0 +1,40 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": true + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": true + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-follower-first.json b/tests/results/test_namespace/40_9leadership-calculation-outside-follower-first.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-follower-first.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-follower-last.json b/tests/results/test_namespace/40_9leadership-calculation-outside-follower-last.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-follower-last.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-follower.json b/tests/results/test_namespace/40_9leadership-calculation-outside-follower.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-follower.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-leader-first.json b/tests/results/test_namespace/40_9leadership-calculation-outside-leader-first.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-leader-first.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-leader-last.json b/tests/results/test_namespace/40_9leadership-calculation-outside-leader-last.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-leader-last.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace/40_9leadership-calculation-outside-leader.json b/tests/results/test_namespace/40_9leadership-calculation-outside-leader.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace/40_9leadership-calculation-outside-leader.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/00_6secret.json b/tests/results/test_namespace_mandatory/00_6secret.json new file mode 100644 index 0000000..2092488 --- /dev/null +++ b/tests/results/test_namespace_mandatory/00_6secret.json @@ -0,0 +1,42 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/04_5disabled_calculation_multi.json b/tests/results/test_namespace_mandatory/04_5disabled_calculation_multi.json new file mode 100644 index 0000000..584a2ae --- /dev/null +++ b/tests/results/test_namespace_mandatory/04_5disabled_calculation_multi.json @@ -0,0 +1,60 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/04_5disabled_calculation_variable_multi.json b/tests/results/test_namespace_mandatory/04_5disabled_calculation_variable_multi.json new file mode 100644 index 0000000..7f98eb8 --- /dev/null +++ b/tests/results/test_namespace_mandatory/04_5disabled_calculation_variable_multi.json @@ -0,0 +1,40 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": true + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": true + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-first.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-first.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-first.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-last.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-last.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower-last.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-follower.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-first.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-first.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-first.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-last.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-last.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader-last.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader.json b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_mandatory/40_9leadership-calculation-outside-leader.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/00_6secret.json b/tests/results/test_namespace_read_write/00_6secret.json new file mode 100644 index 0000000..232be31 --- /dev/null +++ b/tests/results/test_namespace_read_write/00_6secret.json @@ -0,0 +1,42 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "secret1": null, + "secret2": "value" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "secret1": null, + "secret2": "value" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/04_5disabled_calculation_multi.json b/tests/results/test_namespace_read_write/04_5disabled_calculation_multi.json new file mode 100644 index 0000000..b5cb21b --- /dev/null +++ b/tests/results/test_namespace_read_write/04_5disabled_calculation_multi.json @@ -0,0 +1,44 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": "no", + "variable1": [], + "variable2": [] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": "no", + "variable1": [], + "variable2": [] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/04_5disabled_calculation_variable_multi.json b/tests/results/test_namespace_read_write/04_5disabled_calculation_variable_multi.json new file mode 100644 index 0000000..d6bb7fe --- /dev/null +++ b/tests/results/test_namespace_read_write/04_5disabled_calculation_variable_multi.json @@ -0,0 +1,42 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": false, + "variable": [] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": false, + "variable": [] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-first.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-first.json new file mode 100644 index 0000000..0430845 --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-first.json @@ -0,0 +1,68 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-last.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-last.json new file mode 100644 index 0000000..0430845 --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower-last.json @@ -0,0 +1,68 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower.json new file mode 100644 index 0000000..a67a65d --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-follower.json @@ -0,0 +1,70 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11", + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11", + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-first.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-first.json new file mode 100644 index 0000000..ccb34c6 --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-first.json @@ -0,0 +1,64 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-last.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-last.json new file mode 100644 index 0000000..a61b03f --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader-last.json @@ -0,0 +1,64 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value2" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value2" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader.json b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader.json new file mode 100644 index 0000000..b72bf48 --- /dev/null +++ b/tests/results/test_namespace_read_write/40_9leadership-calculation-outside-leader.json @@ -0,0 +1,70 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "value1", + "value2" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "value1", + "value2" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/00_6secret.json b/tests/results/test_namespace_read_write_mandatory/00_6secret.json new file mode 100644 index 0000000..2092488 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/00_6secret.json @@ -0,0 +1,42 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "secret1": "string1", + "secret2": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_multi.json b/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_multi.json new file mode 100644 index 0000000..584a2ae --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_multi.json @@ -0,0 +1,60 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": "string1", + "variable1": [ + "string1", + "string2", + "string3" + ], + "variable2": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_variable_multi.json b/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_variable_multi.json new file mode 100644 index 0000000..7f98eb8 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/04_5disabled_calculation_variable_multi.json @@ -0,0 +1,40 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "condition": true + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "condition": true + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-first.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-first.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-first.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-last.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-last.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower-last.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-follower.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-first.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-first.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-first.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-last.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-last.json new file mode 100644 index 0000000..93ec297 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader-last.json @@ -0,0 +1,74 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader.json b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader.json new file mode 100644 index 0000000..1f62215 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/40_9leadership-calculation-outside-leader.json @@ -0,0 +1,82 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "string1", + "follower1": "string1", + "follower2": "string1" + }, + { + "leader": "string2", + "follower1": "string2", + "follower2": "string2" + }, + { + "leader": "string3", + "follower1": "string3", + "follower2": "string3" + } + ], + "calculate": [ + "string1", + "string2", + "string3" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/00_6secret.json b/tests/results/test_namespace_read_write_mandatory_errors/00_6secret.json new file mode 100644 index 0000000..465a478 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/00_6secret.json @@ -0,0 +1,22 @@ +{ + "_meta": { + "hostvars": { + "localhost": { + "_errors": [ + "The following variables are mandatory but have no value:", + " - rougail.secret1 (the first variable)" + ] + } + } + }, + "all": { + "children": [ + "ungrouped" + ] + }, + "ungrouped": { + "hosts": [ + "localhost" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_multi.json b/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_multi.json new file mode 100644 index 0000000..b173fee --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_multi.json @@ -0,0 +1,23 @@ +{ + "_meta": { + "hostvars": { + "localhost": { + "_errors": [ + "The following variables are mandatory but have no value:", + " - rougail.variable1 (a first variable)", + " - rougail.variable2 (a second variable)" + ] + } + } + }, + "all": { + "children": [ + "ungrouped" + ] + }, + "ungrouped": { + "hosts": [ + "localhost" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_variable_multi.json b/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_variable_multi.json new file mode 100644 index 0000000..9b528c5 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/04_5disabled_calculation_variable_multi.json @@ -0,0 +1,22 @@ +{ + "_meta": { + "hostvars": { + "localhost": { + "_errors": [ + "The following variables are mandatory but have no value:", + " - rougail.variable (a variable)" + ] + } + } + }, + "all": { + "children": [ + "ungrouped" + ] + }, + "ungrouped": { + "hosts": [ + "localhost" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-first.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-first.json new file mode 100644 index 0000000..0430845 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-first.json @@ -0,0 +1,68 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-last.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-last.json new file mode 100644 index 0000000..0430845 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower-last.json @@ -0,0 +1,68 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower.json new file mode 100644 index 0000000..a67a65d --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-follower.json @@ -0,0 +1,70 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11", + "val11" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "val11", + "val11" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-first.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-first.json new file mode 100644 index 0000000..ccb34c6 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-first.json @@ -0,0 +1,64 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-last.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-last.json new file mode 100644 index 0000000..a61b03f --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader-last.json @@ -0,0 +1,64 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value2" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": "value2" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader.json b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader.json new file mode 100644 index 0000000..b72bf48 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/40_9leadership-calculation-outside-leader.json @@ -0,0 +1,70 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "value1", + "value2" + ] + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "leader": [ + { + "leader": "value1", + "follower1": "val11", + "follower2": "val21" + }, + { + "leader": "value2", + "follower1": "val11", + "follower2": "val21" + } + ], + "calculate": [ + "value1", + "value2" + ] + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} diff --git a/tests/test_load.py b/tests/test_load.py index 8b4b53d..2a15ba6 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -59,7 +59,7 @@ def _test_dictionaries(test_dir, namespace, ext, *, read_write=True, mandatory=F if do_calc and (mandatory or not read_write): get_values_for_config(config) ################################## - generated_output = RougailOutput(config, rougailconfig=rougailconfig).run() + generated_output = RougailOutput(config, rougailconfig=rougailconfig).run()[1] output_file = Path(__file__).parent / 'results' / dir_name / (test_dir.name + "." + ext) if not output_file.is_file(): if not output_file.parent.is_dir():