-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple users, filesystem definitions, etc. can't be done #344
Comments
can you please add how to replicate the issue? |
When u add user under customization only the last user been populated in the blueprint. eg it prints only kumar in blueprint |
EG:- [root@node-1 library]# cat ../defaults/main.ymlbuilder_blueprint_name: test_blueprint
user: Wen I present this value in the role builder on default *yml file, after the blue print is created the number of users produced is just one with latest. Only below values are present. irrespective of number of users we provided in the customization we get only last items, you can validate by reviewing under the plugins to create_blueprint on line no:182
|
any update on this one? |
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)
The text was updated successfully, but these errors were encountered: