Skip to content
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

Push the blueprint into image builder #77

Open
tosin2013 opened this issue Mar 25, 2023 · 1 comment
Open

Push the blueprint into image builder #77

tosin2013 opened this issue Mar 25, 2023 · 1 comment

Comments

@tosin2013
Copy link

I am getting the following error when running the following playbook.
Command

ansible-playbook  provisioner/provision_lab.yml -e @extra_vars.yml -i local-inventory.yml -v

Error

TASK [infra.osbuild.builder : Push the blueprint into image builder] *******************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: urllib.error.HTTPError: HTTP Error 400: Bad Request
fatal: [edge-manager-local]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.1.165 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1679757262.7142296-203703-179676720802629/AnsiballZ_push_blueprint.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1679757262.7142296-203703-179676720802629/AnsiballZ_push_blueprint.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/root/.ansible/tmp/ansible-tmp-1679757262.7142296-203703-179676720802629/AnsiballZ_push_blueprint.py\", line 48, in invoke_module\r\n    run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_infra.osbuild.push_blueprint_payload_h0nh14y4/ansible_infra.osbuild.push_blueprint_payload.zip/ansible_collections/infra/osbuild/plugins/modules/push_blueprint.py\", line 89, in <module>\r\n  File \"/tmp/ansible_infra.osbuild.push_blueprint_payload_h0nh14y4/ansible_infra.osbuild.push_blueprint_payload.zip/ansible_collections/infra/osbuild/plugins/modules/push_blueprint.py\", line 84, in main\r\n  File \"/tmp/ansible_infra.osbuild.push_blueprint_payload_h0nh14y4/ansible_infra.osbuild.push_blueprint_payload.zip/ansible_collections/infra/osbuild/plugins/module_utils/weldrapiv1.py\", line 145, in post_blueprint_new\r\n  File \"/tmp/ansible_infra.osbuild.push_blueprint_payload_h0nh14y4/ansible_infra.osbuild.push_blueprint_payload.zip/ansible/module_utils/urls.py\", line 1486, in open\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 223, in urlopen\r\n    return opener.open(url, data, timeout)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 532, in open\r\n    response = meth(req, response)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 642, in http_response\r\n    'http', request, response, code, msg, hdrs)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 570, in error\r\n    return self._call_chain(*args)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 504, in _call_chain\r\n    result = func(*args)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 650, in http_error_default\r\n    raise HTTPError(req.full_url, code, msg, hdrs, fp)\r\nurllib.error.HTTPError: HTTP Error 400: Bad Request\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Manual command

# sudo composer-cli blueprints push  /tmp/blueprint.toml
ERROR: BlueprintsError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand: toml: line 31 (last key "customizations.user.groups"): incompatible types: TOML value has type string; destination has type slice

cat /tmp/blueprint.toml

cat /tmp/blueprint.toml
name = "rhde-image"
description = "rhde-image"
version = "0.0.3"

[[packages]]
name = "vim-enhanced"
version = "*"

[[packages]]
name = "git"
version = "*"

[[packages]]
name = "nano"
version = "*"

[[packages]]
name = "NetworkManager-wifi"
version = "*"

[[packages]]
name = "ansible-core"
version = "*"

[customizations]

[[customizations.user]]
name = "ansible"
description = "ansible"
password = "lab-admin-password"
groups = "[\"users\", \"wheel\"]"
@tosin2013
Copy link
Author

This is was the current workaround for me

sed -i '16d' provisioner/workshop_vars/rhde_aw_120.yml
cat provisioner/workshop_vars/rhde_aw_120.yml | grep groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant