Description
Unable to create multiple users or filesystem due to module dict can only contain one of each key,
From create blue print.py:-
line no: 177
toml_data["customizations"]: dict = {}
for key, customization in module.params["customizations"].items():
if isinstance(customization, str):
toml_data["customizations"][key]: str = customization
continue
# TODO since the module dict can only contain one of each key,
# multiple users, filesystem definitions, etc. can't be done yet
double_square_brackets: list = ["user", "filesystem", "sshkey", "directories", "files"]
if key in double_square_brackets:
toml_data["customizations"][key]: list = []
toml_data["customizations"][key].append(customization)
else:
toml_data["customizations"][key]: dict = customization
try:
with open(module.params["dest"], "w") as fd:
weldr.toml.dump(toml_data, fd)
except Exception as e:
module.fail_json(msg=f'Failed to write to file: {module.params["dest"]}', error=e)
module.exit_json(msg=f'Blueprint file written to location: {module.params["dest"]}', changed=True, current_version=blueprint_version)
Activity