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

fix EDA parameters' names #1031

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

ivarmu
Copy link
Contributor

@ivarmu ivarmu commented Feb 4, 2025

What does this PR do?

While developing the redhat-cop/aap_configuration_extended#67, many issues has arised:

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": []}
TASK [infra.aap_configuration.eda_rulebook_activations : Create rulebook_activation | Wait for finish the rulebook_activation creation] *****************************************************************************************************
FAILED - RETRYING: [localhost]: Create rulebook_activation | Wait for finish the rulebook_activation creation (50 retries left).
failed: [localhost] (item=Create/Update rulebook activation test activation | Wait for finish the rulebook activation creation) => {"__rulebook_activations_job_async_result_item": {"__ra_item": {"decision_environment": "Default Decision Environment", "description": "", "name": "test activation", "organization_name": "Default", "project_name": "test", "rulebook_name": "hello_events.yml", "status": "stopped"}, "ansible_job_id": "j880154664816.480292", "ansible_loop_var": "__ra_item", "changed": false, "failed": 0, "finished": 0, "results_file": "/home/ivan/.ansible_async/j880154664816.480292", "started": 1}, "ansible_job_id": "j880154664816.480292", "ansible_loop_var": "__rulebook_activations_job_async_result_item", "attempts": 2, "changed": false, "finished": 1, "msg": "state is present but all of the following are missing: rulebook_name, project_name", "results_file": "/home/ivan/.ansible_async/j880154664816.480292", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
TASK [infra.aap_configuration.eda_rulebook_activations : Add EDA Controller rulebook activation] ********************************************************************************************************************************************
ok: [localhost] => (item=Create/Update the rulebook activation test activation to EDA)

TASK [infra.aap_configuration.eda_rulebook_activations : Create rulebook_activation | Wait for finish the rulebook_activation creation] *****************************************************************************************************
FAILED - RETRYING: [localhost]: Create rulebook_activation | Wait for finish the rulebook_activation creation (50 retries left).
failed: [localhost] (item=Create/Update rulebook activation test activation | Wait for finish the rulebook activation creation) => {"__rulebook_activations_job_async_result_item": {"__ra_item": {"decision_environment": "Default Decision Environment", "description": "", "name": "test activation", "organization_name": "Default", "project_name": "test", "rulebook_name": "hello_events.yml", "status": "stopped"}, "ansible_job_id": "j733119952251.484606", "ansible_loop_var": "__ra_item", "changed": false, "failed": 0, "finished": 0, "results_file": "/home/ivan/.ansible_async/j733119952251.484606", "started": 1}, "ansible_job_id": "j733119952251.484606", "ansible_loop_var": "__rulebook_activations_job_async_result_item", "attempts": 2, "changed": false, "finished": 1, "msg": "Parameter organization_name is required when state is present for this version of EDA.", "results_file": "/home/ivan/.ansible_async/j733119952251.484606", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
$ 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
$ ansible-galaxy collection list

# /home/ivan/.ansible/collections/ansible_collections
Collection                               Version    
---------------------------------------- -----------
ansible.hub                              1.0.0      
awx.awx                                  24.6.1     
fedora.linux_system_roles                1.78.1     
infra.aap_configuration                  3.0.0      
infra.aap_configuration_extended         1.0.0-devel
infra.ah_configuration                   2.0.6      
infra.controller_configuration           2.9.0      
infra.convert2rhel                       1.1.0      
infra.leapp                              1.2.0      
infra.lvm_snapshots                      2.0.3      
redhat.satellite                         4.2.0      

# /usr/lib/python3.13/site-packages/ansible_collections
Collection                               Version    
---------------------------------------- -----------
amazon.aws                               7.6.1      
ansible.netcommon                        5.3.0      
ansible.posix                            1.6.2      
ansible.utils                            2.12.0     
ansible.windows                          2.5.0      
arista.eos                               6.2.2      
awx.awx                                  23.9.0     
azure.azcollection                       1.19.0     
check_point.mgmt                         5.2.3      
chocolatey.chocolatey                    1.5.3      
cisco.aci                                2.10.1     
cisco.asa                                4.0.3      
cisco.dnac                               6.25.0     
cisco.intersight                         2.0.20     
cisco.ios                                5.3.0      
cisco.iosxr                              6.1.1      
cisco.ise                                2.9.6      
cisco.meraki                             2.18.3     
cisco.mso                                2.9.0      
cisco.nxos                               5.3.0      
cisco.ucs                                1.14.0     
cloud.common                             2.1.4      
cloudscale_ch.cloud                      2.4.0      
community.aws                            7.2.0      
community.azure                          2.0.0      
community.ciscosmb                       1.0.9      
community.crypto                         2.22.3     
community.digitalocean                   1.27.0     
community.dns                            2.9.8      
community.docker                         3.13.3     
community.general                        8.6.8      
community.grafana                        1.9.1      
community.hashi_vault                    6.2.0      
community.hrobot                         1.9.4      
community.library_inventory_filtering_v1 1.0.2      
community.libvirt                        1.3.0      
community.mongodb                        1.7.8      
community.mysql                          3.11.0     
community.network                        5.1.0      
community.okd                            2.3.0      
community.postgresql                     3.9.0      
community.proxysql                       1.6.0      
community.rabbitmq                       1.3.0      
community.routeros                       2.20.0     
community.sap                            2.0.0      
community.sap_libs                       1.4.2      
community.sops                           1.9.1      
community.vmware                         4.8.1      
community.windows                        2.3.0      
community.zabbix                         2.5.1      
containers.podman                        1.16.2     
cyberark.conjur                          1.3.1      
cyberark.pas                             1.0.30     
dellemc.enterprise_sonic                 2.5.1      
dellemc.openmanage                       8.7.0      
dellemc.powerflex                        2.5.0      
dellemc.unity                            1.7.1      
f5networks.f5_modules                    1.32.1     
fortinet.fortimanager                    2.8.2      
fortinet.fortios                         2.3.8      
frr.frr                                  2.0.2      
gluster.gluster                          1.0.2      
google.cloud                             1.4.1      
grafana.grafana                          2.2.5      
hetzner.hcloud                           2.5.0      
hpe.nimble                               1.1.4      
ibm.qradar                               2.1.0      
ibm.spectrum_virtualize                  2.0.0      
ibm.storage_virtualize                   2.5.0      
ieisystem.inmanage                       2.0.0      
infinidat.infinibox                      1.4.5      
infoblox.nios_modules                    1.7.1      
inspur.ispim                             2.2.3      
inspur.sm                                2.3.0      
junipernetworks.junos                    5.3.1      
kaytus.ksmanage                          1.2.2      
kubernetes.core                          2.4.2      
lowlydba.sqlserver                       2.3.4      
microsoft.ad                             1.7.1      
netapp.aws                               21.7.1     
netapp.azure                             21.10.1    
netapp.cloudmanager                      21.24.0    
netapp.elementsw                         21.7.0     
netapp.ontap                             22.13.0    
netapp.storagegrid                       21.13.0    
netapp.um_info                           21.8.1     
netapp_eseries.santricity                1.4.1      
netbox.netbox                            3.20.0     
ngine_io.cloudstack                      2.5.0      
ngine_io.exoscale                        1.1.0      
openstack.cloud                          2.3.0      
openvswitch.openvswitch                  2.1.1      
ovirt.ovirt                              3.2.0      
purestorage.flasharray                   1.32.0     
purestorage.flashblade                   1.19.1     
purestorage.fusion                       1.6.1      
sensu.sensu_go                           1.14.0     
splunk.es                                2.1.2      
t_systems_mms.icinga_director            2.0.1      
telekom_mms.icinga_director              1.35.0     
theforeman.foreman                       3.15.0     
vmware.vmware                            1.7.1      
vmware.vmware_rest                       2.3.1      
vultr.cloud                              1.13.0     
vyos.vyos                                4.1.0      
wti.remote                               1.0.10     

How should this be tested?

This has been manually tested.

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc

redhat-cop/aap_configuration_extended#67

@ivarmu ivarmu requested a review from a team as a code owner February 4, 2025 11:22
Copy link
Collaborator

@Tompage1994 Tompage1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this one. This will break things for people who already include https:// on their aap_hostname variable.

I think what really needs to be done here is raising an issue against the ansible.eda collection to add the same logic that the other collections have where the https://is added when not specified

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

Successfully merging this pull request may close these issues.

2 participants