feat: add namespace_is_hostname option

This commit is contained in:
egarette@silique.fr 2025-01-02 21:38:17 +01:00
parent 82b4a29b33
commit 773f991274
30 changed files with 1190 additions and 46 deletions

View file

@ -18,7 +18,7 @@ msgstr ""
#: src/rougail/output_exporter/__init__.py:73 #: src/rougail/output_exporter/__init__.py:73
msgid "The following variables are mandatory but have no value:" msgid "The following variables are mandatory but have no value:"
msgstr "Les variables suiveuses sont obligatoire mais n'ont pas de valeur :" msgstr "Les variables suivantes sont obligatoire mais n'ont pas de valeur :"
#: src/rougail/output_exporter/__init__.py:84 #: src/rougail/output_exporter/__init__.py:84
msgid "The following variables are inaccessible but are empty and mandatory :" msgid "The following variables are inaccessible but are empty and mandatory :"

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-01 11:03+0100\n" "POT-Creation-Date: 2024-12-29 10:03+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,43 +15,19 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: src/rougail/output_exporter/__init__.py:73 #: src/rougail/output_ansible/__init__.py:55
msgid "The following variables are mandatory but have no value:" msgid "no namespace configured"
msgstr "" msgstr ""
#: src/rougail/output_exporter/__init__.py:84 #: src/rougail/output_ansible/__init__.py:63
msgid "The following variables are inaccessible but are empty and mandatory :" msgid "cannot find hosts namespace \"{0}\""
msgstr "" msgstr ""
#: src/rougail/output_exporter/output/console.py:53 #: src/rougail/output_ansible/__init__.py:68
msgid "Undocumented variable" msgid "malformated hosts namespace \"{0}\", should has \"hostnames\""
msgstr "" msgstr ""
#: src/rougail/output_exporter/output/console.py:54 #: src/rougail/output_ansible/__init__.py:95
msgid "Undocumented but modified variable" msgid "cannot find \"hostnames\" in \"{0}\" namespace"
msgstr ""
#: src/rougail/output_exporter/output/console.py:57
msgid "Unmodifiable variable"
msgstr ""
#: src/rougail/output_exporter/output/console.py:61
msgid "Default value"
msgstr ""
#: src/rougail/output_exporter/output/console.py:62
msgid "Modified value"
msgstr ""
#: src/rougail/output_exporter/output/console.py:63
msgid "Original default value"
msgstr ""
#: src/rougail/output_exporter/output/console.py:67
msgid "Caption"
msgstr ""
#: src/rougail/output_exporter/output/console.py:92
msgid "Variables:"
msgstr "" msgstr ""

View file

@ -20,6 +20,7 @@ from typing import Optional
from json import dumps from json import dumps
from tiramisu import groups from tiramisu import groups
from rougail.utils import normalize_family
from .i18n import _ from .i18n import _
from ..output_json import RougailOutputJson from ..output_json import RougailOutputJson
@ -42,6 +43,7 @@ class RougailOutputAnsible(RougailOutputJson):
except AttributeError: except AttributeError:
self.support_namespace = False self.support_namespace = False
self.host_namespace = self.rougailconfig["ansible.host_namespace"] self.host_namespace = self.rougailconfig["ansible.host_namespace"]
self.namespace_is_hostname = self.rougailconfig["ansible.namespace_is_hostname"]
def exporter(self) -> None: def exporter(self) -> None:
super().exporter() super().exporter()
@ -99,11 +101,20 @@ class RougailOutputAnsible(RougailOutputJson):
ret_hosts = {} ret_hosts = {}
for name, hosts in hostnames.items(): for name, hosts in hostnames.items():
if 'hosts' in hosts: if 'hosts' in hosts:
if 'prefix_name' in hosts:
host_name = hosts['prefix_name']
add_index = True
elif len(hosts["hosts"]) == 1:
host_name = hosts["hosts"][0]
add_index = False
else:
raise Exception("cannot find prefix_name")
for idx, host in enumerate(hosts['hosts']): for idx, host in enumerate(hosts['hosts']):
index = str(idx + 1) index = str(idx + 1)
if idx < 9: if idx < 9:
index = '0' + index index = '0' + index
host_name = hosts['prefix_name'] + index if 'prefix_name' in hosts:
host_name = hosts['prefix_name'] + index
ret_hosts.setdefault(name, {})[host_name] = host ret_hosts.setdefault(name, {})[host_name] = host
ret.setdefault(name, {}).setdefault('hosts', []).append(host_name) ret.setdefault(name, {}).setdefault('hosts', []).append(host_name)
else: else:
@ -112,7 +123,12 @@ class RougailOutputAnsible(RougailOutputJson):
for hosts in ret_hosts.values(): for hosts in ret_hosts.values():
for host, domain_name in hosts.items(): for host, domain_name in hosts.items():
ret['_meta']['hostvars'][host] = {'ansible_host': domain_name} ret['_meta']['hostvars'][host] = {'ansible_host': domain_name}
ret['_meta']['hostvars'][host].update(self.dico) if self.namespace_is_hostname:
host_namespace = normalize_family(host)
if host_namespace in self.dico:
ret['_meta']['hostvars'][host].update(self.dico[host_namespace])
else:
ret['_meta']['hostvars'][host].update(self.dico)
self.dico = ret self.dico = ret

View file

@ -25,8 +25,8 @@ def get_rougail_config(
) -> dict: ) -> dict:
options = """ options = """
list: list:
description: parameter added only to be compatible with Ansible description: parameter added only to be compatible with Ansible
negative_description: parameter added only to be compatible with Ansible negative_description: parameter added only to be compatible with Ansible
default: false default: false
disabled: disabled:
type: jinja type: jinja
@ -53,6 +53,11 @@ ansible:
host_namespace: host_namespace:
description: Namespace with host values description: Namespace with host values
default: "hosts" default: "hosts"
namespace_is_hostname:
description: Only variables in hostname namespace is available by a host
negative_description: All variables is available for all hosts
default: false
""" """
return { return {
"name": "ansible", "name": "ansible",

View file

@ -5,19 +5,23 @@ hostnames:
hidden: true hidden: true
group1: group1:
hosts: hosts:
type: domainname type: domainname
multi: true multi: true
default: default:
- group1.net - group1.net
prefix_name: prefix_name:
default: GROUP1_ default: GROUP1_
group2: group2:
hosts: hosts:
type: domainname type: domainname
multi: true multi: true
default: default:
- group2.net - group2.net
prefix_name: prefix_name:
default: GROUP2_ default: GROUP2_

View file

@ -0,0 +1,42 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,46 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -14,7 +14,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",
@ -55,7 +59,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",

View file

@ -0,0 +1,36 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,134 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,42 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,46 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -14,7 +14,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",
@ -55,7 +59,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",

View file

@ -0,0 +1,36 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,134 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,42 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var1": null,
"var2": null
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var1": null,
"var2": null
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,46 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"variable": "value in extra"
},
"extra": {
"variable": "value in extra"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"variable": "value in extra"
},
"extra": {
"variable": "value in extra"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -6,7 +6,7 @@
"rougail": { "rougail": {
"var1": [], "var1": [],
"var2": [], "var2": [],
"var3": null, "var3": [],
"var4": [ "var4": [
"value" "value"
], ],
@ -29,7 +29,7 @@
"rougail": { "rougail": {
"var1": [], "var1": [],
"var2": [], "var2": [],
"var3": null, "var3": [],
"var4": [ "var4": [
"value" "value"
], ],

View file

@ -0,0 +1,36 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,58 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": []
},
"dynval2": {
"var": []
}
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": []
},
"dynval2": {
"var": []
}
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,42 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var1": "string1",
"var2": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,46 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"variable": "string1"
},
"extra": {
"variable": "string1"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -14,7 +14,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",
@ -55,7 +59,11 @@
"string2", "string2",
"string3" "string3"
], ],
"var3": "string1", "var3": [
"string1",
"string2",
"string3"
],
"var4": [ "var4": [
"string1", "string1",
"string2", "string2",

View file

@ -0,0 +1,36 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,134 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
},
"dynval2": {
"var": [
"string1",
"string2",
"string3"
],
"dyn_string1": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string2": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
},
"dyn_string3": {
"var": "string1",
"var_identifier": "string1",
"var_identifiers": "string1"
}
}
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,23 @@
{
"_meta": {
"hostvars": {
"localhost": {
"_errors": [
"The following variables are mandatory but have no value:",
" - rougail.var1 (a first variable)",
" - rougail.var2 (a second variable)"
]
}
}
},
"all": {
"children": [
"ungrouped"
]
},
"ungrouped": {
"hosts": [
"localhost"
]
}
}

View file

@ -0,0 +1,46 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"variable": "value in extra"
},
"extra": {
"variable": "value in extra"
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"variable": "value in extra"
},
"extra": {
"variable": "value in extra"
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,36 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}

View file

@ -0,0 +1,58 @@
{
"_meta": {
"hostvars": {
"GROUP1_01": {
"ansible_host": "group1.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": []
},
"dynval2": {
"var": []
}
}
},
"GROUP2_01": {
"ansible_host": "group2.net",
"rougail": {
"var": [
"val1",
"val2"
],
"dynval1": {
"var": []
},
"dynval2": {
"var": []
}
}
}
}
},
"all": {
"children": [
"ungrouped",
"groups"
]
},
"group1": {
"hosts": [
"GROUP1_01"
]
},
"group2": {
"hosts": [
"GROUP2_01"
]
},
"groups": {
"children": [
"group1",
"group2"
]
}
}