Skip to content

controller_host parameter requires an URL instead of a hostname #397

@ivarmu

Description

@ivarmu

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that event-driven-ansible collection is open source software provided for free and that I might not receive a timely response.

Bug Summary

The parameter controller_host used in each ansible.eda module requires a value that is an URL instead of a host name. All other Ansible collections let's specifying a hostname. The following condition should be reconsidered:

if not (host or "").startswith(("https://", "http://")):

This issue was detected at redhat-cop/infra.aap_configuration#1031

Environment

$ ansible --version
ansible [core 2.16.14]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ivan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.13/site-packages/ansible
  ansible collection location = /home/ivan/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.13.1 (main, Dec  9 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] (/usr/bin/python3)
  jinja version = 3.1.5
  libyaml = True

Steps to reproduce

see redhat-cop/infra.aap_configuration#1031

Actual results

TASK [infra.aap_configuration.eda_projects : Create project | Wait for finish the project creation] *****************************************************************************************************************************************
FAILED - RETRYING: [localhost]: Create project | Wait for finish the project creation (50 retries left).
failed: [localhost] (item=Create/Update project test project | Wait for finish the project creation) => {"__projects_job_async_result_item": {"__project_item": {"description": "", "name": "test project", "organization": "2", "scm_branch": "", "scm_refspec": "", "scm_type": "git"}, "ansible_job_id": "j480528279495.469244", "ansible_loop_var": "__project_item", "changed": false, "failed": 0, "finished": 0, "results_file": "/home/ivan/.ansible_async/j480528279495.469244", "started": 1}, "ansible_job_id": "j480528279495.469244", "ansible_loop_var": "__projects_job_async_result_item", "attempts": 2, "changed": false, "cmd": "/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py", "data": "", "finished": 1, "msg": "Traceback (most recent call last):\n  File \"/tmp/ansible_ansible.legacy.async_wrapper_payload_xh85w3_4/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py\", line 180, in _run_module\n  File \"/tmp/ansible_ansible.legacy.async_wrapper_payload_xh85w3_4/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py\", line 98, in _filter_non_json_lines\nValueError: No start of json char found\n", "results_file": "/home/ivan/.ansible_async/j480528279495.469244", "started": 1, "stderr": "Traceback (most recent call last):\n  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 107, in <module>\n    _ansiballz_main()\n    ~~~~~~~~~~~~~~~^^\n  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.ansible.eda.plugins.modules.project', init_globals=dict(_module_fqn='ansible_collections.ansible.eda.plugins.modules.project', _modlib_path=modlib_path),\n    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                     run_name='__main__', alter_sys=True)\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/modules/project.py\", line 250, in <module>\n  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/modules/project.py\", line 136, in main\n  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/module_utils/client.py\", line 54, in __init__\nansible_collections.ansible.eda.plugins.module_utils.errors.EDAHTTPError: Invalid instance host value: 'aap25-gateway.iam.lab'. Value must start with 'https://' or 'http://'\n", "stderr_lines": ["Traceback (most recent call last):", "  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 107, in <module>", "    _ansiballz_main()", "    ~~~~~~~~~~~~~~~^^", "  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 99, in _ansiballz_main", "    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)", "    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", "  File \"/home/ivan/.ansible/tmp/ansible-tmp-1738664810.1470587-469228-85103433100762/AnsiballZ_project.py\", line 47, in invoke_module", "    runpy.run_module(mod_name='ansible_collections.ansible.eda.plugins.modules.project', init_globals=dict(_module_fqn='ansible_collections.ansible.eda.plugins.modules.project', _modlib_path=modlib_path),", "    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", "                     run_name='__main__', alter_sys=True)", "                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", "  File \"<frozen runpy>\", line 226, in run_module", "  File \"<frozen runpy>\", line 98, in _run_module_code", "  File \"<frozen runpy>\", line 88, in _run_code", "  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/modules/project.py\", line 250, in <module>", "  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/modules/project.py\", line 136, in main", "  File \"/tmp/ansible_ansible.eda.project_payload_q5bq6y04/ansible_ansible.eda.project_payload.zip/ansible_collections/ansible/eda/plugins/module_utils/client.py\", line 54, in __init__", "ansible_collections.ansible.eda.plugins.module_utils.errors.EDAHTTPError: Invalid instance host value: 'aap25-gateway.iam.lab'. Value must start with 'https://' or 'http://'"], "stdout": "", "stdout_lines": []}

Expected results

ansible.eda.* should accept a hostname as a value for the parameter controller_host.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions