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

InvalidApiVersionParameter) The api-version '2021-03-01' is invalid #1739

Open
khain0 opened this issue Oct 10, 2024 · 35 comments
Open

InvalidApiVersionParameter) The api-version '2021-03-01' is invalid #1739

khain0 opened this issue Oct 10, 2024 · 35 comments
Labels
medium_priority Medium priority not a bug Not a bug question Further information is requested work in In trying to solve, or in working with contributors

Comments

@khain0
Copy link

khain0 commented Oct 10, 2024

SUMMARY

Invoking azure_rm_virtualnetwork_info ends with error InvalidApiVersionParameter

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm_virtualnetwork_info

ANSIBLE VERSION
ansible [core 2.14.13]
  config file = /home/runner/.ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.18 (main, Sep 22 2023, 17:58:34) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /usr/share/ansible/collections/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 2.7.0
community.general  9.5.0
CONFIGURATION
[defaults]
python_interpreter: auto_silent
OS / ENVIRONMENT

Ansible Automation Platform 4.5.8 (bundle version 2.4.1)
Execution Environment build based on registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:latest

STEPS TO REPRODUCE
  1. Build a container based on dockerfile
---
version: 1

dependencies:
  galaxy: requirements.yml
  python: requirements.txt

build_arg_defaults:
  EE_BASE_IMAGE: registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:latest
  EE_BUILDER_IMAGE: registry.redhat.io/ansible-automation-platform-23/ansible-builder-rhel8:latest

additional_build_steps:
  prepend:
    # User configuration, using ansible key to allow write
    - COPY ansible.cfg /home/runner/.ansible.cfg
    - COPY id_ansible /home/runner/.ssh/id_ansible
    - RUN chmod 600 /home/runner/.ssh/id_ansible

cat requirements.yml

---
collections:
- name: community.general
- name: azure.azcollection

cat requirements.txt

pip>=22.0.3
packaging
requests[security]
xmltodict
azure-cli-core>=2.34.0
azure-common>=1.1.11
azure-identity>=1.7.0
azure-mgmt-authorization>=2.0.0
azure-mgmt-apimanagement>=3.0.0
azure-mgmt-batch>=5.0.1
azure-mgmt-cdn>=11.0.0
azure-mgmt-compute>=26.1.0
azure-mgmt-containerinstance>=9.0.0
azure-mgmt-core>=1.3.0
azure-mgmt-containerregistry>=9.1.0
azure-containerregistry>=1.0.0
azure-mgmt-containerservice>=20.0.0
azure-mgmt-datalake-store>=1.0.0
azure-mgmt-datafactory>=2.0.0
azure-mgmt-dns>=8.0.0
azure-mgmt-marketplaceordering>=0.1.0
azure-mgmt-monitor>=3.0.0
azure-mgmt-managedservices>=6.0.0
azure-mgmt-managementgroups>=0.2.0
azure-mgmt-network>=19.1.0
azure-mgmt-nspkg>=2.0.0
azure-mgmt-privatedns>=1.0.0
azure-mgmt-redis>=13.0.0
azure-mgmt-resource>=21.1.0
azure-mgmt-rdbms>=10.0.0
azure-mgmt-search>=8.0.0
azure-mgmt-servicebus>=7.1.0
azure-mgmt-sql>=3.0.1
azure-mgmt-storage>=19.0.0
azure-mgmt-trafficmanager>=1.0.0b1
azure-mgmt-web>=6.1.0
azure-nspkg>=2.0.0
azure-storage-blob>=12.11.0
msrest>=0.7.1
msrestazure>=0.6.4
azure-keyvault>=1.1.0
azure-mgmt-keyvault>=10.0.0
azure-graphrbac>=0.61.1
azure-mgmt-cosmosdb>=6.4.0
azure-mgmt-hdinsight>=9.0.0
azure-mgmt-devtestlabs>=3.0.0
azure-mgmt-loganalytics>=12.0.0
azure-mgmt-automation>=1.0.0
azure-mgmt-iothub>=2.2.0
azure-mgmt-recoveryservices>=2.0.0
azure-mgmt-recoveryservicesbackup>=3.0.0
azure-mgmt-notificationhubs>=7.0.0
azure-mgmt-eventhub>=10.1.0
msgraph-core
  1. Import Execution Environment to Ansible Automation Platform
  2. Run a job from the following playbook in Ansible Automation Platform using created Execution Environment:
---
- name: Deploy single host in Azure
  hosts: localhost
  gather_facts: false

  tasks:
    - import_role:
       name: azure_deploy_host

cat azure_deploy_host/tasks/main.yml

- name: Get facts for a virtual network.
  azure_rm_virtualnetwork_info:
    resource_group: "{{ azure_spoke_vnet_resource_group }}"
    name: '{{ azure_spoke_vnet_name }}'
    client_id: '{{ azure_clientid }}'
    secret: '{{ azure_secret }}'
    tenant: '{{ azure_tenant }}'
    subscription_id: '{{ azure_subscription_id }}'
    cloud_environment: "{{ azure_config[ azure_resource_location ]['cloud_environment'] }}"
EXPECTED RESULTS

Getting virtual network info on Azure West Europe Region works fine. I can get virtual networks info succesfully.

TASK [azure_deploy_host : Get facts for a virtual network.] ********************
task path: /runner/project/roles/azure_deploy_host/tasks/main.yml:36
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f522e6e5bb0> for vault_id=default
redirecting (type: modules) ansible.builtin.azure_rm_virtualnetwork_info to azure.azcollection.azure_rm_virtualnetwork_info
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/runner/.ansible/tmp `"&& mkdir "` echo /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090 `" && echo ansible-tmp-1728556790.3079984-68-97067236001090="` echo /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.azure_rm_virtualnetwork_info to azure.azcollection.azure_rm_virtualnetwork_info
Using module file /runner/requirements_collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py
<127.0.0.1> PUT /home/runner/.ansible/tmp/ansible-local-210wrmahoc/tmp_25_eg3q TO /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090/AnsiballZ_azure_rm_virtualnetwork_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090/ /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090/AnsiballZ_azure_rm_virtualnetwork_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.9 /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090/AnsiballZ_azure_rm_virtualnetwork_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/runner/.ansible/tmp/ansible-tmp-1728556790.3079984-68-97067236001090/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ad_user": null,
            "adfs_authority_url": null,
            "api_profile": "latest",
            "auth_source": "auto",
            "cert_validation_mode": null,
            "client_id": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "cloud_environment": "AzureCloud",
            "disable_instance_discovery": false,
            "log_mode": null,
            "log_path": null,
            "name": "Spoke-VNet",
            "password": null,
            "profile": null,
            "resource_group": "CENSORED",
            "secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "subscription_id": "CENSORED",
  …
ACTUAL RESULTS

Getting virtual network info on Azure East US 2 Region does NOT work.
The error is:

File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2021_03_01/operations/_virtual_networks_operations.py\", line 214, in get\n    raise HttpResponseError(response=response, error_format=ARMErrorFormat)\nazure.core.exceptions.HttpResponseError: (InvalidApiVersionParameter) The api-version '2021-03-01' is invalid.
TASK [azure_deploy_host : Get facts for a virtual network.] ********************
task path: /runner/project/roles/azure_deploy_host/tasks/main.yml:36
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f5ed38e56d0> for vault_id=default
redirecting (type: modules) ansible.builtin.azure_rm_virtualnetwork_info to azure.azcollection.azure_rm_virtualnetwork_info
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/runner/.ansible/tmp `"&& mkdir "` echo /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112 `" && echo ansible-tmp-1728557849.1265497-68-157001238358112="` echo /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.azure_rm_virtualnetwork_info to azure.azcollection.azure_rm_virtualnetwork_info
Using module file /runner/requirements_collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py
<127.0.0.1> PUT /home/runner/.ansible/tmp/ansible-local-218czz2cpm/tmptmpuy429 TO /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/ /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.9 /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),
  File "/usr/lib64/python3.9/runpy.py", line 225, in run_mod…

JSON job details:

{
  "module_stdout": "",
  "module_stderr": "Traceback (most recent call last):\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2021_03_01/operations/_virtual_networks_operations.py\", line 214, in get\n    raise HttpResponseError(response=response, error_format=ARMErrorFormat)\nazure.core.exceptions.HttpResponseError: (InvalidApiVersionParameter) The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\nCode: InvalidApiVersionParameter\nMessage: The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\n",
  "exception": "Traceback (most recent call last):\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1728557849.1265497-68-157001238358112/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_h4i500c4/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2021_03_01/operations/_virtual_networks_operations.py\", line 214, in get\n    raise HttpResponseError(response=response, error_format=ARMErrorFormat)\nazure.core.exceptions.HttpResponseError: (InvalidApiVersionParameter) The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\nCode: InvalidApiVersionParameter\nMessage: The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\n",
  "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
  "rc": 1,
  "_ansible_no_log": null,
  "changed": false
}
CHARACTERIZATION/ISOLATION

Module works for Azure West Europe, but does not work for Azure East US 2 region.

@Fred-sun
Copy link
Collaborator

@khain0 This error is caused by the inconsistency between the version of azure.azcolleciton you installed and the required version of azure-mgmt-network. We have updated to the latest version in PR #1697, so the required package also needs to be updated simultaneously. Thank you!

If #1697 has been synchronized, Please install azure-mgmt-network==26.0.0,
if not, install azure-mgmt-network==19.1.0

@Fred-sun Fred-sun added question Further information is requested medium_priority Medium priority not a bug Not a bug work in In trying to solve, or in working with contributors labels Oct 10, 2024
@khain0
Copy link
Author

khain0 commented Oct 10, 2024

@Fred-sun
I made a modification in my requirements.txt file, but it still tries to install azure_mgmt_network 19.1.0.

cat requirements.yml

---
collections:
- name: community.general
- name: azure.azcollection
  version: 2.7.0

cat requirements.txt

pip>=22.0.3
packaging
requests[security]
xmltodict
azure-cli-core>=2.61.0
azure-common>=1.1.11
azure-identity>=1.16.1
azure-mgmt-authorization>=2.0.0
azure-mgmt-apimanagement>=3.0.0
azure-mgmt-batch>=16.2.0
azure-mgmt-compute>=30.6.0
azure-mgmt-cdn>=13.1.1
azure-mgmt-containerinstance>=9.0.0
azure-mgmt-core>=1.4.0
azure-mgmt-containerregistry>=9.1.0
azure-containerregistry>=1.1.0
azure-mgmt-containerservice>=31.0.0
azure-mgmt-datafactory>=2.0.0
azure-mgmt-dns>=8.0.0
azure-mgmt-marketplaceordering>=1.1.0
azure-mgmt-monitor>=3.0.0
azure-mgmt-managedservices>=6.0.0
azure-mgmt-managementgroups>=1.0.0
azure-mgmt-network>=26.0.0
azure-mgmt-nspkg>=2.0.0
azure-mgmt-privatedns>=1.0.0
azure-mgmt-redis>=13.1.0
azure-mgmt-resource>=21.1.0
azure-mgmt-rdbms>=10.2.0b12
azure-mgmt-search>=8.0.0
azure-mgmt-servicebus>=7.1.0
azure-mgmt-sql>=3.0.1
azure-mgmt-storage>=19.0.0
azure-mgmt-trafficmanager>=1.0.0b1
azure-mgmt-web>=6.1.0
azure-nspkg>=2.0.0
azure-storage-blob>=12.13.0
azure-keyvault>=4.2.0
azure-mgmt-keyvault>=10.0.0
azure-mgmt-cosmosdb>=9.5.1
azure-mgmt-hdinsight>=9.0.0
azure-mgmt-devtestlabs>=3.0.0
azure-mgmt-loganalytics>=12.0.0
azure-mgmt-automation>=1.0.0
azure-mgmt-iothub>=3.0.0
azure-iot-hub>=2.6.1;platform_machine=="x86_64"
azure-mgmt-recoveryservices>=2.0.0
azure-mgmt-recoveryservicesbackup>=3.0.0
azure-mgmt-notificationhubs>=7.0.0
azure-mgmt-eventhub>=10.1.0

Output from building an image

requirements-parser 0.11.0 requires packaging>=23.2, but you'll have packaging 21.3 which is incompatible.
--> ce1480a412e8
[3/4] STEP 10/13: COPY --from=galaxy /usr/share/ansible /usr/share/ansible
--> 8d0d618d9cbe
[3/4] STEP 11/13: COPY _build/requirements.txt requirements.txt
--> 242c35e0f1a1
[3/4] STEP 12/13: RUN $PYCMD /output/scripts/introspect.py introspect --sanitize --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
Creating parent directory for /tmp/src/requirements.txt
---
python:
- 'packaging  # from collection azure.azcollection,user'
- 'requests  # from collection azure.azcollection,user'
- 'xmltodict  # from collection azure.azcollection,user'
- 'msgraph_sdk==1.0.0  # from collection azure.azcollection'
- 'azure_cli_core==2.61.0,>=2.61.0  # from collection azure.azcollection,user'
- 'azure_common==1.1.11,>=1.1.11  # from collection azure.azcollection,user'
- 'azure_identity==1.16.1,>=1.16.1  # from collection azure.azcollection,user'
- 'azure_mgmt_authorization==2.0.0,>=2.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_apimanagement==3.0.0,>=3.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_batch==16.2.0,>=16.2.0  # from collection azure.azcollection,user'
- 'azure_mgmt_compute==30.6.0,>=30.6.0  # from collection azure.azcollection,user'
- 'azure_mgmt_cdn==13.1.1,>=13.1.1  # from collection azure.azcollection,user'
- 'azure_mgmt_containerinstance==9.0.0,>=9.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_core==1.4.0,>=1.4.0  # from collection azure.azcollection,user'
- 'azure_mgmt_containerregistry==9.1.0,>=9.1.0  # from collection azure.azcollection,user'
- 'azure_containerregistry==1.1.0,>=1.1.0  # from collection azure.azcollection,user'
- 'azure_mgmt_containerservice==31.0.0,>=31.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_datafactory==2.0.0,>=2.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_dns==8.0.0,>=8.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_marketplaceordering==1.1.0,>=1.1.0  # from collection azure.azcollection,user'
- 'azure_mgmt_monitor==3.0.0,>=3.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_managedservices==6.0.0,>=6.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_managementgroups==1.0.0,>=1.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_network==19.1.0,>=26.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_nspkg==2.0.0,>=2.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_privatedns==1.0.0,>=1.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_redis==13.1.0,>=13.1.0  # from collection azure.azcollection,user'
- 'azure_mgmt_resource==21.1.0,>=21.1.0  # from collection azure.azcollection,user'
- 'azure_mgmt_rdbms==10.2.0b12,>=10.2.0b12  # from collection azure.azcollection,user'
- 'azure_mgmt_search==8.0.0,>=8.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_servicebus==7.1.0,>=7.1.0  # from collection azure.azcollection,user'
- 'azure_mgmt_sql==3.0.1,>=3.0.1  # from collection azure.azcollection,user'
- 'azure_mgmt_storage==19.0.0,>=19.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_trafficmanager==1.0.0b1,>=1.0.0b1  # from collection azure.azcollection,user'
- 'azure_mgmt_web==6.1.0,>=6.1.0  # from collection azure.azcollection,user'
- 'azure_nspkg==2.0.0,>=2.0.0  # from collection azure.azcollection,user'
- 'azure_storage_blob==12.13.0,>=12.13.0  # from collection azure.azcollection,user'
- 'azure_core==1.28.0  # from collection azure.azcollection'
- 'azure_keyvault==4.2.0,>=4.2.0  # from collection azure.azcollection,user'
- 'azure_mgmt_keyvault==10.0.0,>=10.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_cosmosdb==9.5.1,>=9.5.1  # from collection azure.azcollection,user'
- 'azure_mgmt_hdinsight==9.0.0,>=9.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_devtestlabs==9.0.0,>=3.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_loganalytics==12.0.0,>=12.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_automation==1.0.0,>=1.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_iothub==3.0.0,>=3.0.0  # from collection azure.azcollection,user'
- 'azure_iot_hub==2.6.1,>=2.6.1  # from collection azure.azcollection,user'
- 'azure_mgmt_recoveryservices==2.0.0,>=2.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_recoveryservicesbackup==3.0.0,>=3.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_notificationhubs==7.0.0,>=7.0.0  # from collection azure.azcollection,user'
- 'azure_mgmt_eventhub==10.1.0,>=10.1.0  # from collection azure.azcollection,user'
- 'pip>=22.0.3  # from collection user'

At the end I get an error:

ERROR: Could not find a version that satisfies the requirement azure_mgmt_network==19.1.0,>=26.0.0 (from -r /tmp/src/requirements.txt (line 24)) (from versions: 0.20.0rc1, 0.20.0rc2, 0.20.0, 0.20.1, 0.30.0a1, 0.30.0rc1, 0.30.0rc2, 0.30.0rc3, 0.30.0rc4, 0.30.0rc5, 0.30.0rc6, 0.30.0, 0.30.1, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0rc1, 1.5.0rc3, 1.5.0, 1.6.0, 1.7.0, 1.7.1, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.5.0, 2.5.1, 2.6.0rc1, 2.6.0, 2.7.0, 3.0.0, 4.0.0, 5.0.0, 5.1.0, 6.0.0, 7.0.0, 8.0.0, 9.0.0, 10.0.0, 10.1.0, 10.2.0, 11.0.0, 12.0.0, 13.0.0, 16.0.0b1, 16.0.0, 17.0.0, 17.1.0, 18.0.0, 19.0.0, 19.1.0, 19.2.0, 19.3.0, 20.0.0, 21.0.0, 21.0.1, 22.0.0, 22.1.0, 22.2.0, 22.3.0, 23.0.0b1, 23.0.0b2, 23.0.0, 23.0.1, 23.1.0, 24.0.0, 25.0.0, 25.1.0, 25.2.0, 25.3.0, 25.4.0, 26.0.0, 27.0.0)
ERROR: No matching distribution found for azure_mgmt_network==19.1.0,>=26.0.0 (from -r /tmp/src/requirements.txt (line 24))
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

An error occurred (rc=1), see output line(s) above for details.

@khain0
Copy link
Author

khain0 commented Oct 10, 2024

I switched to ansible-builder version 3.1.0 (previous one was 3.0.0).
My execution_environment.yml looks like this:

---
version: 3

dependencies:
  galaxy: ./requirements.yml
  python: ./requirements.txt

images:
  base_image:
    name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest
  # build_image:
    #name: registry.redhat.io/ansible-automation-platform-24/ansible-builder-rhel8:latest

additional_build_steps:
  prepend_base:
    # User configuration, using ansible key to allow write
    - COPY ansible.cfg /home/runner/.ansible.cfg
    - COPY id_ansible /home/runner/.ssh/id_ansible
    - RUN chmod 600 /home/runner/.ssh/id_ansible

I took dependencies from https://github.com/ansible-collections/azure/blob/v2.7.0/requirements.txt
but I changed the line to:

azure-mgmt-network==26.0.0

I get the error while building Execution Environment

ERROR: Cannot install azure-mgmt-network==19.1.0 and azure-mgmt-network==26.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested azure-mgmt-network==19.1.0
    The user requested azure-mgmt-network==26.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

No idea why it tries to get version 19.1.0 of azure-mgmt-network from requirements.

@Fred-sun
Copy link
Collaborator

@khain0 From the error, it is caused by the version conflict. Can you uninstall 'azure-mgmt-network' and try it again? Thank you!!

ansible-galaxy collection install azure.azcollection --force
sudo pip3 uninstall azure-mgmt-network (makesure uninstall)
sudo pip3 install azure-mgmt-network==19.1.0

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

It does not work like that. ansible-builder builds an images based on requirements. I do not have installation on azue-mgmt-network locally.

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

When I use requirements from dev. https://github.com/ansible-collections/azure/blob/dev/requirements.txt
I got this error.

ERROR: Cannot install msgraph-sdk==1.0.0 and msgraph-sdk==1.6.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested msgraph-sdk==1.0.0
    The user requested msgraph-sdk==1.6.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

Two lists are created during building an image using ansible-builder with requiremesnts downgraded to version 2.7.0 of azure collection: https://github.com/ansible-collections/azure/blob/v2.7.0/requirements.txt
These two lists have conflict with azure-mgmt-network.
How to force builder to use the highest version only?

[3/4] STEP 13/14: RUN $PYCMD /output/scripts/introspect.py introspect --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
Creating parent directory for /tmp/src/requirements.txt
---
python:
- 'packaging  # from collection azure.azcollection'
- 'requests[security]  # from collection azure.azcollection'
- 'xmltodict  # from collection azure.azcollection'
- 'msgraph-sdk==1.0.0  # from collection azure.azcollection'
- 'azure-cli-core==2.61.0  # from collection azure.azcollection'
- 'azure-common==1.1.11  # from collection azure.azcollection'
- 'azure-identity==1.16.1  # from collection azure.azcollection'
- 'azure-mgmt-authorization==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-apimanagement==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-batch==16.2.0  # from collection azure.azcollection'
- 'azure-mgmt-compute==30.6.0  # from collection azure.azcollection'
- 'azure-mgmt-cdn==13.1.1  # from collection azure.azcollection'
- 'azure-mgmt-containerinstance==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-core==1.4.0  # from collection azure.azcollection'
- 'azure-mgmt-containerregistry==9.1.0  # from collection azure.azcollection'
- 'azure-containerregistry==1.1.0  # from collection azure.azcollection'
- 'azure-mgmt-containerservice==31.0.0  # from collection azure.azcollection'
- 'azure-mgmt-datafactory==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-dns==8.0.0  # from collection azure.azcollection'
- 'azure-mgmt-marketplaceordering==1.1.0  # from collection azure.azcollection'
- 'azure-mgmt-monitor==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-managedservices==6.0.0  # from collection azure.azcollection'
- 'azure-mgmt-managementgroups==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-network==19.1.0  # from collection azure.azcollection'
- 'azure-mgmt-nspkg==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-privatedns==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-redis==13.1.0  # from collection azure.azcollection'
- 'azure-mgmt-resource==21.1.0  # from collection azure.azcollection'
- 'azure-mgmt-rdbms==10.2.0b12  # from collection azure.azcollection'
- 'azure-mgmt-search==8.0.0  # from collection azure.azcollection'
- 'azure-mgmt-servicebus==7.1.0  # from collection azure.azcollection'
- 'azure-mgmt-sql==3.0.1  # from collection azure.azcollection'
- 'azure-mgmt-storage==19.0.0  # from collection azure.azcollection'
- 'azure-mgmt-trafficmanager==1.0.0b1  # from collection azure.azcollection'
- 'azure-mgmt-web==6.1.0  # from collection azure.azcollection'
- 'azure-nspkg==2.0.0  # from collection azure.azcollection'
- 'azure-storage-blob==12.13.0  # from collection azure.azcollection'
- 'azure-core==1.28.0  # from collection azure.azcollection'
- 'azure-keyvault==4.2.0  # from collection azure.azcollection'
- 'azure-mgmt-keyvault==10.0.0  # from collection azure.azcollection'
- 'azure-mgmt-cosmosdb==9.5.1  # from collection azure.azcollection'
- 'azure-mgmt-hdinsight==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-devtestlabs==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-loganalytics==12.0.0  # from collection azure.azcollection'
- 'azure-mgmt-automation==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-iothub==3.0.0  # from collection azure.azcollection'
- 'azure-iot-hub==2.6.1;platform_machine=="x86_64"  # from collection azure.azcollection'
- 'azure-mgmt-recoveryservices==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-recoveryservicesbackup==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-notificationhubs==7.0.0  # from collection azure.azcollection'
- 'azure-mgmt-eventhub==10.1.0  # from collection azure.azcollection'
- 'packaging  # from collection user'
- 'requests[security]  # from collection user'
- 'xmltodict  # from collection user'
- 'msgraph-sdk==1.0.0  # from collection user'
- 'azure-cli-core==2.61.0  # from collection user'
- 'azure-common==1.1.11  # from collection user'
- 'azure-identity==1.16.1  # from collection user'
- 'azure-mgmt-authorization==2.0.0  # from collection user'
- 'azure-mgmt-apimanagement==3.0.0  # from collection user'
- 'azure-mgmt-batch==16.2.0  # from collection user'
- 'azure-mgmt-compute==30.6.0  # from collection user'
- 'azure-mgmt-cdn==13.1.1  # from collection user'
- 'azure-mgmt-containerinstance==9.0.0  # from collection user'
- 'azure-mgmt-core==1.4.0  # from collection user'
- 'azure-mgmt-containerregistry==9.1.0  # from collection user'
- 'azure-containerregistry==1.1.0  # from collection user'
- 'azure-mgmt-containerservice==31.0.0  # from collection user'
- 'azure-mgmt-datafactory==2.0.0  # from collection user'
- 'azure-mgmt-dns==8.0.0  # from collection user'
- 'azure-mgmt-marketplaceordering==1.1.0  # from collection user'
- 'azure-mgmt-monitor==3.0.0  # from collection user'
- 'azure-mgmt-managedservices==6.0.0  # from collection user'
- 'azure-mgmt-managementgroups==1.0.0  # from collection user'
- 'azure-mgmt-network==26.0.0  # from collection user'
- 'azure-mgmt-nspkg==2.0.0  # from collection user'
- 'azure-mgmt-privatedns==1.0.0  # from collection user'
- 'azure-mgmt-redis==13.1.0  # from collection user'
- 'azure-mgmt-resource==21.1.0  # from collection user'
- 'azure-mgmt-rdbms==10.2.0b12  # from collection user'
- 'azure-mgmt-search==8.0.0  # from collection user'
- 'azure-mgmt-servicebus==7.1.0  # from collection user'
- 'azure-mgmt-sql==3.0.1  # from collection user'
- 'azure-mgmt-storage==19.0.0  # from collection user'
- 'azure-mgmt-trafficmanager==1.0.0b1  # from collection user'
- 'azure-mgmt-web==6.1.0  # from collection user'
- 'azure-nspkg==2.0.0  # from collection user'
- 'azure-storage-blob==12.13.0  # from collection user'
- 'azure-core==1.28.0  # from collection user'
- 'azure-keyvault==4.2.0  # from collection user'
- 'azure-mgmt-keyvault==10.0.0  # from collection user'
- 'azure-mgmt-cosmosdb==9.5.1  # from collection user'
- 'azure-mgmt-hdinsight==9.0.0  # from collection user'
- 'azure-mgmt-devtestlabs==9.0.0  # from collection user'
- 'azure-mgmt-loganalytics==12.0.0  # from collection user'
- 'azure-mgmt-automation==1.1.0  # from collection user'
system: []

At the end I get

ERROR: Cannot install azure-mgmt-network==19.1.0 and azure-mgmt-network==26.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested azure-mgmt-network==19.1.0
    The user requested azure-mgmt-network==26.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

An error occurred (rc=1), see output line(s) above for details.

@Fred-sun
Copy link
Collaborator

@khain0 What kind of environment are you working in? Could you please help provide the versions of azure. azcollection and azure-mgmt-network?

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

@Fred-sun
I do not have any environment installed on my machine.
I use ansible-builder which gets required python modules and ansible collection during the process of building the image.
In other words: I do not install ansible-galaxy collection on my machine and do not install any python modules locally.
I use ansible-builder version 3.1.0 and perform a command:

ansible-builder build -v 3 --no-cache --prune-images -f azure-ee.yml -t localhost/azure:6.0

The result of the command should be a podman image whith ansible collection and python modules installed inside the image.
The image is then used as Execution Environment in Ansible Automation Platform. The Execution Environment is then used as podman container as an environment to execute a playbook which starts provisioning a virtual machines in Azure.

ansible-builder runs on Red Hat Enterprise Linux 8.10
Azure collection is take from requirements.yml file, which currently looks like this:

---
collections:
- name: community.general
- name: azure.azcollection
  version: 2.7.0
  dependencies:
    python:
      - azure-mgmt-network==26.0.0

azure-mgmt-network version is taken from requirements.txt:

packaging
requests[security]
xmltodict
msgraph-sdk==1.0.0
azure-cli-core==2.61.0
azure-common==1.1.11
azure-identity==1.16.1
azure-mgmt-authorization==2.0.0
azure-mgmt-apimanagement==3.0.0
azure-mgmt-batch==16.2.0
azure-mgmt-compute==30.6.0
azure-mgmt-cdn==13.1.1
azure-mgmt-containerinstance==9.0.0
azure-mgmt-core==1.4.0
azure-mgmt-containerregistry==9.1.0
azure-containerregistry==1.1.0
azure-mgmt-containerservice==31.0.0
azure-mgmt-datafactory==2.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-marketplaceordering==1.1.0
azure-mgmt-monitor==3.0.0
azure-mgmt-managedservices==6.0.0
azure-mgmt-managementgroups==1.0.0
azure-mgmt-network==26.0.0
azure-mgmt-nspkg==2.0.0
azure-mgmt-privatedns==1.0.0
azure-mgmt-redis==13.1.0
azure-mgmt-resource==21.1.0
azure-mgmt-rdbms==10.2.0b12
azure-mgmt-search==8.0.0
azure-mgmt-servicebus==7.1.0
azure-mgmt-sql==3.0.1
azure-mgmt-storage==19.0.0
azure-mgmt-trafficmanager==1.0.0b1
azure-mgmt-web==6.1.0
azure-nspkg==2.0.0
azure-storage-blob==12.13.0
azure-core==1.28.0
azure-keyvault==4.2.0
azure-mgmt-keyvault==10.0.0
azure-mgmt-cosmosdb==9.5.1
azure-mgmt-hdinsight==9.0.0
azure-mgmt-devtestlabs==9.0.0
azure-mgmt-loganalytics==12.0.0
azure-mgmt-automation==1.1.0

The whole output of command:
ansible-builder build -v 3 -f azure-ee.yml -t localhost/azure:6.0

Ansible Builder is generating your execution environment build context.
File context/_build/requirements.yml is already up-to-date.
File context/_build/requirements.txt had modifications and will be rewritten
File context/_build/scripts/assemble is already up-to-date.
File context/_build/scripts/install-from-bindep is already up-to-date.
File context/_build/scripts/introspect.py is already up-to-date.
File context/_build/scripts/check_galaxy is already up-to-date.
File context/_build/scripts/check_ansible is already up-to-date.
File context/_build/scripts/pip_install is already up-to-date.
File context/_build/scripts/entrypoint is already up-to-date.
Ansible Builder is building your execution environment image. Tags: localhost/azure:6.0
Running command:
  podman build -f context/Containerfile -t localhost/azure:6.0 context
[1/4] STEP 1/15: FROM registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest AS base
[1/4] STEP 2/15: USER root
--> Using cache ebad0cad53e57f9efba182b686a269391e0919cb8933431479c67d7b2728d95d
--> ebad0cad53e5
[1/4] STEP 3/15: ENV PIP_BREAK_SYSTEM_PACKAGES=1
--> Using cache 998bd38e232d433237e86020bf49dba0846dbeb9d992787dde48dd6d9a932007
--> 998bd38e232d
[1/4] STEP 4/15: ARG EE_BASE_IMAGE
--> Using cache 5006cceec407a6c36667a0ddad3dbc160423f0926ff47ffd9ed6007bb076eefd
--> 5006cceec407
[1/4] STEP 5/15: ARG PYCMD
--> Using cache d9e18f3a567e85bb74d7f479da01ce48f7430d49609395336a4a7b776238fd12
--> d9e18f3a567e
[1/4] STEP 6/15: ARG PKGMGR_PRESERVE_CACHE
--> Using cache d1369a41d0d1a4e33665b10717471e0c4ee9d96e42a3b390838075059ee39551
--> d1369a41d0d1
[1/4] STEP 7/15: ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS
--> Using cache 00ac533ea477a8613c614007932ae1e132ac55548f2960d5ef7076a4fba00dc5
--> 00ac533ea477
[1/4] STEP 8/15: ARG ANSIBLE_GALAXY_CLI_ROLE_OPTS
--> Using cache 88eed51408c93276abaa408fd6bb61bc52036e9da800ae81b721fd05b0579972
--> 88eed51408c9
[1/4] STEP 9/15: ARG PKGMGR
--> Using cache 5590b00cbba43ae71f343204131ef81a787f37183403842cf6bbdfe31f58f4a2
--> 5590b00cbba4
[1/4] STEP 10/15: COPY _build/scripts/ /output/scripts/
--> Using cache 166664a637db9d1608eb3148a4f26dd90a9b6d9fe3bc658e008d349a620168d2
--> 166664a637db
[1/4] STEP 11/15: COPY _build/scripts/entrypoint /opt/builder/bin/entrypoint
--> Using cache b518647021f3b7e7863dbbc5589b689878e1b42ada4033c70b7bbf71351aa9b2
--> b518647021f3
[1/4] STEP 12/15: COPY ansible.cfg /home/runner/.ansible.cfg
--> Using cache bc12e36a0bb5bd437be133b8cb70232198ba04bc15198b3d026a9266bce9dcee
--> bc12e36a0bb5
[1/4] STEP 13/15: COPY id_ansible /home/runner/.ssh/id_ansible
--> Using cache 01c7b28d3a82d3fbb52640bc7d62197e9397d3d3f7afaab8a902205a9886c556
--> 01c7b28d3a82
[1/4] STEP 14/15: RUN chmod 600 /home/runner/.ssh/id_ansible
--> Using cache a8498542133df145e07cd7d79eddcd32530b3be7ae041e51d63be0745fcccfe0
--> a8498542133d
[1/4] STEP 15/15: RUN /output/scripts/pip_install $PYCMD
--> Using cache 00c98c1eccfb8be4c7b326fd42baae4461b1654cdc1ca86aee727d2b66e7b498
--> 00c98c1eccfb
[2/4] STEP 1/13: FROM 00c98c1eccfb8be4c7b326fd42baae4461b1654cdc1ca86aee727d2b66e7b498 AS galaxy
[2/4] STEP 2/13: ARG EE_BASE_IMAGE
--> Using cache 0121e87739c417737f952e05cac238576974f67247060a69e0c9dc2e74aad33c
--> 0121e87739c4
[2/4] STEP 3/13: ARG PYCMD
--> Using cache 0d4afeaf7dfbbb18c4fdcadafd5ef6b58c43f2ded9e3be74b7fea9c0e0506aef
--> 0d4afeaf7dfb
[2/4] STEP 4/13: ARG PKGMGR_PRESERVE_CACHE
--> Using cache a5149f04f842b25c7fdf274148f121d288e4033409d1e209fd0c029fdbad39fc
--> a5149f04f842
[2/4] STEP 5/13: ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS
--> Using cache 07b1973f460671f1c004aefd715b29ad85e4f97fcf847bf34f1d64630be83afd
--> 07b1973f4606
[2/4] STEP 6/13: ARG ANSIBLE_GALAXY_CLI_ROLE_OPTS
--> Using cache c123176135b72e978cef15a38155ba479154497ad25b17128e72c2298e234a51
--> c123176135b7
[2/4] STEP 7/13: ARG PKGMGR
--> Using cache 1140a8d17d58b9ba922e7d47cdcef5b125f3e718a46754ad0c3ad514c3981bba
--> 1140a8d17d58
[2/4] STEP 8/13: RUN /output/scripts/check_galaxy
--> Using cache 243a5268f3845c92b310f05c4a2f6ac0386535849f819ab34745b33adfb44cb6
--> 243a5268f384
[2/4] STEP 9/13: COPY _build /build
--> bb9e85ae8cab
[2/4] STEP 10/13: WORKDIR /build
--> 644e0cdb9886
[2/4] STEP 11/13: RUN mkdir -p /usr/share/ansible
--> f7249892a12d
[2/4] STEP 12/13: RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"
Skipping install, no requirements found
--> 78e6a73dc9d1
[2/4] STEP 13/13: RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path "/usr/share/ansible/collections"
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/azure-azcollection-2.7.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-12i1vjmu5/tmpkovdiyvn/azure-azcollection-2.7.0-etxz66xm
Installing 'azure.azcollection:2.7.0' to '/usr/share/ansible/collections/ansible_collections/azure/azcollection'
azure.azcollection:2.7.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-9.5.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-12i1vjmu5/tmpkovdiyvn/community-general-9.5.0-1r6nzapu
Installing 'community.general:9.5.0' to '/usr/share/ansible/collections/ansible_collections/community/general'
community.general:9.5.0 was installed successfully
--> 0c7ef462cb68
[3/4] STEP 1/14: FROM 00c98c1eccfb8be4c7b326fd42baae4461b1654cdc1ca86aee727d2b66e7b498 AS builder
[3/4] STEP 2/14: ENV PIP_BREAK_SYSTEM_PACKAGES=1
--> Using cache a3f7be0560ee54c41201fe4dec457ef17ab1eb8c0de74692765d33c096b54219
--> a3f7be0560ee
[3/4] STEP 3/14: WORKDIR /build
--> Using cache 03f7011e45d890da3214d75484a03546feadd99d48ad7d773077f90b45ff287e
--> 03f7011e45d8
[3/4] STEP 4/14: ARG EE_BASE_IMAGE
--> Using cache 228f0b219826cb727db14df998de51eb71a10909ccf1a4366da5542982272464
--> 228f0b219826
[3/4] STEP 5/14: ARG PYCMD
--> Using cache e13f82ddd290bcc2c0996e91c453c8c369cb9d61dab114d3b8dc21f850189fe5
--> e13f82ddd290
[3/4] STEP 6/14: ARG PKGMGR_PRESERVE_CACHE
--> Using cache 738721e86b1b1ec6743e968c3f12928cbe3a3d63c11c0d9ddb260562e4c95b89
--> 738721e86b1b
[3/4] STEP 7/14: ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS
--> Using cache c92d2545c75d99fbdbf1d43e3f52d50d8a71e9d7c7bf9f1781de7a184e683748
--> c92d2545c75d
[3/4] STEP 8/14: ARG ANSIBLE_GALAXY_CLI_ROLE_OPTS
--> Using cache bd3f734eb553ff1fd4e3a2564756a2d474477f2917d67b64780b23a158d3ef96
--> bd3f734eb553
[3/4] STEP 9/14: ARG PKGMGR
--> Using cache 0cdaf83ca6d7798c91ede2cca3a1199ea0a6142a87cd72cd8b5c04f12a495b5f
--> 0cdaf83ca6d7
[3/4] STEP 10/14: RUN $PYCMD -m pip install --no-cache-dir bindep pyyaml packaging
--> Using cache 1f86072171d291b5287823d3247e5abd582793eb4b5c3451d3ed4e0e255f9eba
--> 1f86072171d2
[3/4] STEP 11/14: COPY --from=galaxy /usr/share/ansible /usr/share/ansible
--> Using cache 91f7af612299c6da5527978c676c66611d05a9e611bd47f6f95b967de36447a9
--> 91f7af612299
[3/4] STEP 12/14: COPY _build/requirements.txt requirements.txt
--> 5b40541a8d7b
[3/4] STEP 13/14: RUN $PYCMD /output/scripts/introspect.py introspect --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
Creating parent directory for /tmp/src/requirements.txt
---
python:
- 'packaging  # from collection azure.azcollection'
- 'requests[security]  # from collection azure.azcollection'
- 'xmltodict  # from collection azure.azcollection'
- 'msgraph-sdk==1.0.0  # from collection azure.azcollection'
- 'azure-cli-core==2.61.0  # from collection azure.azcollection'
- 'azure-common==1.1.11  # from collection azure.azcollection'
- 'azure-identity==1.16.1  # from collection azure.azcollection'
- 'azure-mgmt-authorization==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-apimanagement==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-batch==16.2.0  # from collection azure.azcollection'
- 'azure-mgmt-compute==30.6.0  # from collection azure.azcollection'
- 'azure-mgmt-cdn==13.1.1  # from collection azure.azcollection'
- 'azure-mgmt-containerinstance==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-core==1.4.0  # from collection azure.azcollection'
- 'azure-mgmt-containerregistry==9.1.0  # from collection azure.azcollection'
- 'azure-containerregistry==1.1.0  # from collection azure.azcollection'
- 'azure-mgmt-containerservice==31.0.0  # from collection azure.azcollection'
- 'azure-mgmt-datafactory==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-dns==8.0.0  # from collection azure.azcollection'
- 'azure-mgmt-marketplaceordering==1.1.0  # from collection azure.azcollection'
- 'azure-mgmt-monitor==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-managedservices==6.0.0  # from collection azure.azcollection'
- 'azure-mgmt-managementgroups==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-network==19.1.0  # from collection azure.azcollection'
- 'azure-mgmt-nspkg==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-privatedns==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-redis==13.1.0  # from collection azure.azcollection'
- 'azure-mgmt-resource==21.1.0  # from collection azure.azcollection'
- 'azure-mgmt-rdbms==10.2.0b12  # from collection azure.azcollection'
- 'azure-mgmt-search==8.0.0  # from collection azure.azcollection'
- 'azure-mgmt-servicebus==7.1.0  # from collection azure.azcollection'
- 'azure-mgmt-sql==3.0.1  # from collection azure.azcollection'
- 'azure-mgmt-storage==19.0.0  # from collection azure.azcollection'
- 'azure-mgmt-trafficmanager==1.0.0b1  # from collection azure.azcollection'
- 'azure-mgmt-web==6.1.0  # from collection azure.azcollection'
- 'azure-nspkg==2.0.0  # from collection azure.azcollection'
- 'azure-storage-blob==12.13.0  # from collection azure.azcollection'
- 'azure-core==1.28.0  # from collection azure.azcollection'
- 'azure-keyvault==4.2.0  # from collection azure.azcollection'
- 'azure-mgmt-keyvault==10.0.0  # from collection azure.azcollection'
- 'azure-mgmt-cosmosdb==9.5.1  # from collection azure.azcollection'
- 'azure-mgmt-hdinsight==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-devtestlabs==9.0.0  # from collection azure.azcollection'
- 'azure-mgmt-loganalytics==12.0.0  # from collection azure.azcollection'
- 'azure-mgmt-automation==1.0.0  # from collection azure.azcollection'
- 'azure-mgmt-iothub==3.0.0  # from collection azure.azcollection'
- 'azure-iot-hub==2.6.1;platform_machine=="x86_64"  # from collection azure.azcollection'
- 'azure-mgmt-recoveryservices==2.0.0  # from collection azure.azcollection'
- 'azure-mgmt-recoveryservicesbackup==3.0.0  # from collection azure.azcollection'
- 'azure-mgmt-notificationhubs==7.0.0  # from collection azure.azcollection'
- 'azure-mgmt-eventhub==10.1.0  # from collection azure.azcollection'
- 'packaging  # from collection user'
- 'requests[security]  # from collection user'
- 'xmltodict  # from collection user'
- 'msgraph-sdk==1.0.0  # from collection user'
- 'azure-cli-core==2.61.0  # from collection user'
- 'azure-common==1.1.11  # from collection user'
- 'azure-identity==1.16.1  # from collection user'
- 'azure-mgmt-authorization==2.0.0  # from collection user'
- 'azure-mgmt-apimanagement==3.0.0  # from collection user'
- 'azure-mgmt-batch==16.2.0  # from collection user'
- 'azure-mgmt-compute==30.6.0  # from collection user'
- 'azure-mgmt-cdn==13.1.1  # from collection user'
- 'azure-mgmt-containerinstance==9.0.0  # from collection user'
- 'azure-mgmt-core==1.4.0  # from collection user'
- 'azure-mgmt-containerregistry==9.1.0  # from collection user'
- 'azure-containerregistry==1.1.0  # from collection user'
- 'azure-mgmt-containerservice==31.0.0  # from collection user'
- 'azure-mgmt-datafactory==2.0.0  # from collection user'
- 'azure-mgmt-dns==8.0.0  # from collection user'
- 'azure-mgmt-marketplaceordering==1.1.0  # from collection user'
- 'azure-mgmt-monitor==3.0.0  # from collection user'
- 'azure-mgmt-managedservices==6.0.0  # from collection user'
- 'azure-mgmt-managementgroups==1.0.0  # from collection user'
- 'azure-mgmt-network==26.0.0  # from collection user'
- 'azure-mgmt-nspkg==2.0.0  # from collection user'
- 'azure-mgmt-privatedns==1.0.0  # from collection user'
- 'azure-mgmt-redis==13.1.0  # from collection user'
- 'azure-mgmt-resource==21.1.0  # from collection user'
- 'azure-mgmt-rdbms==10.2.0b12  # from collection user'
- 'azure-mgmt-search==8.0.0  # from collection user'
- 'azure-mgmt-servicebus==7.1.0  # from collection user'
- 'azure-mgmt-sql==3.0.1  # from collection user'
- 'azure-mgmt-storage==19.0.0  # from collection user'
- 'azure-mgmt-trafficmanager==1.0.0b1  # from collection user'
- 'azure-mgmt-web==6.1.0  # from collection user'
- 'azure-nspkg==2.0.0  # from collection user'
- 'azure-storage-blob==12.13.0  # from collection user'
- 'azure-core==1.28.0  # from collection user'
- 'azure-keyvault==4.2.0  # from collection user'
- 'azure-mgmt-keyvault==10.0.0  # from collection user'
- 'azure-mgmt-cosmosdb==9.5.1  # from collection user'
- 'azure-mgmt-hdinsight==9.0.0  # from collection user'
- 'azure-mgmt-devtestlabs==9.0.0  # from collection user'
- 'azure-mgmt-loganalytics==12.0.0  # from collection user'
- 'azure-mgmt-automation==1.1.0  # from collection user'
system: []

--> 636d2b923cf7
[3/4] STEP 14/14: RUN /output/scripts/assemble
++ source /etc/os-release
+++ NAME='Red Hat Enterprise Linux'
+++ VERSION='9.4 (Plow)'
+++ ID=rhel
+++ ID_LIKE=fedora
+++ VERSION_ID=9.4
+++ PLATFORM_ID=platform:el9
+++ PRETTY_NAME='Red Hat Enterprise Linux 9.4 (Plow)'
+++ ANSI_COLOR='0;31'
+++ LOGO=fedora-logo-icon
+++ CPE_NAME=cpe:/o:redhat:enterprise_linux:9::baseos
+++ HOME_URL=https://www.redhat.com/
+++ DOCUMENTATION_URL=https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9
+++ BUG_REPORT_URL=https://issues.redhat.com/
+++ REDHAT_BUGZILLA_PRODUCT='Red Hat Enterprise Linux 9'
+++ REDHAT_BUGZILLA_PRODUCT_VERSION=9.4
+++ REDHAT_SUPPORT_PRODUCT='Red Hat Enterprise Linux'
+++ REDHAT_SUPPORT_PRODUCT_VERSION=9.4
++ echo rhel
+ RELEASE=rhel
+ PKGMGR=/usr/bin/dnf
+ PKGMGR_OPTS=
+ PKGMGR_PRESERVE_CACHE=
+ PYCMD=/usr/bin/python3
+ PIPCMD='/usr/bin/python3 -m pip'
+ '[' -z /usr/bin/dnf ']'
+ '[' /usr/bin/dnf = /usr/bin/microdnf ']'
+ mkdir -p /output/bindep
+ mkdir -p /output/wheels
+ mkdir -p /tmp/src
+ cd /tmp/src
+ PACKAGES=
+ PIP_OPTS=
+ install_bindep
+ '[' -f bindep.txt ']'
+ /usr/bin/python3 -m venv /tmp/venv --system-site-packages --without-pip
+ source /tmp/venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/tmp/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ PS1='(venv) '
++ export PS1
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
+ '[' -f /tmp/src/upper-constraints.txt ']'
+ [[ -n '' ]]
+ install_wheels
+ '[' -f /tmp/src/build-requirements.txt ']'
+ '[' -f setup.py ']'
+ '[' -f /tmp/src/requirements.txt ']'
+ '[' '!' -f /output/requirements.txt ']'
+ /usr/bin/python3 -m pip install --cache-dir=/output/wheels -r /tmp/src/requirements.txt
Requirement already satisfied: packaging in /usr/lib/python3.9/site-packages (from -r /tmp/src/requirements.txt (line 1)) (21.3)
Requirement already satisfied: requests[security] in /usr/lib/python3.9/site-packages (from -r /tmp/src/requirements.txt (line 2)) (2.32.2)
Requirement already satisfied: xmltodict in /usr/local/lib/python3.9/site-packages (from -r /tmp/src/requirements.txt (line 3)) (0.12.0)
Collecting msgraph-sdk==1.0.0
  Downloading msgraph_sdk-1.0.0-py3-none-any.whl (20.1 MB)
Collecting azure-cli-core==2.61.0
  Downloading azure_cli_core-2.61.0-py3-none-any.whl (251 kB)
Collecting azure-common==1.1.11
  Downloading azure_common-1.1.11-py2.py3-none-any.whl (9.7 kB)
Collecting azure-identity==1.16.1
  Downloading azure_identity-1.16.1-py3-none-any.whl (166 kB)
Collecting azure-mgmt-authorization==2.0.0
  Downloading azure_mgmt_authorization-2.0.0-py2.py3-none-any.whl (465 kB)
Collecting azure-mgmt-apimanagement==3.0.0
  Downloading azure_mgmt_apimanagement-3.0.0-py3-none-any.whl (588 kB)
Collecting azure-mgmt-batch==16.2.0
  Downloading azure_mgmt_batch-16.2.0-py3-none-any.whl (126 kB)
Collecting azure-mgmt-compute==30.6.0
  Downloading azure_mgmt_compute-30.6.0-py3-none-any.whl (5.3 MB)
Collecting azure-mgmt-cdn==13.1.1
  Downloading azure_mgmt_cdn-13.1.1-py3-none-any.whl (288 kB)
Collecting azure-mgmt-containerinstance==9.0.0
  Downloading azure_mgmt_containerinstance-9.0.0-py2.py3-none-any.whl (57 kB)
Collecting azure-mgmt-core==1.4.0
  Downloading azure_mgmt_core-1.4.0-py3-none-any.whl (27 kB)
Collecting azure-mgmt-containerregistry==9.1.0
  Downloading azure_mgmt_containerregistry-9.1.0-py3-none-any.whl (1.1 MB)
Collecting azure-containerregistry==1.1.0
  Downloading azure_containerregistry-1.1.0-py3-none-any.whl (101 kB)
Collecting azure-mgmt-containerservice==31.0.0
  Downloading azure_mgmt_containerservice-31.0.0-py3-none-any.whl (9.7 MB)
Collecting azure-mgmt-datafactory==2.0.0
  Downloading azure_mgmt_datafactory-2.0.0-py2.py3-none-any.whl (514 kB)
Collecting azure-mgmt-dns==8.0.0
  Downloading azure_mgmt_dns-8.0.0-py2.py3-none-any.whl (118 kB)
Collecting azure-mgmt-marketplaceordering==1.1.0
  Downloading azure_mgmt_marketplaceordering-1.1.0-py2.py3-none-any.whl (26 kB)
Collecting azure-mgmt-monitor==3.0.0
  Downloading azure_mgmt_monitor-3.0.0-py2.py3-none-any.whl (839 kB)
Collecting azure-mgmt-managedservices==6.0.0
  Downloading azure_mgmt_managedservices-6.0.0-py2.py3-none-any.whl (47 kB)
Collecting azure-mgmt-managementgroups==1.0.0
  Downloading azure_mgmt_managementgroups-1.0.0-py2.py3-none-any.whl (58 kB)
Collecting azure-mgmt-network==19.1.0
  Downloading azure_mgmt_network-19.1.0-py2.py3-none-any.whl (22.0 MB)
Collecting azure-mgmt-nspkg==2.0.0
  Downloading azure_mgmt_nspkg-2.0.0-py2.py3-none-any.whl (2.8 kB)
Collecting azure-mgmt-privatedns==1.0.0
  Downloading azure_mgmt_privatedns-1.0.0-py2.py3-none-any.whl (43 kB)
Collecting azure-mgmt-redis==13.1.0
  Downloading azure_mgmt_redis-13.1.0-py2.py3-none-any.whl (87 kB)
Collecting azure-mgmt-resource==21.1.0
  Downloading azure_mgmt_resource-21.1.0-py3-none-any.whl (1.8 MB)
Collecting azure-mgmt-rdbms==10.2.0b12
  Downloading azure_mgmt_rdbms-10.2.0b12-py3-none-any.whl (950 kB)
Collecting azure-mgmt-search==8.0.0
  Downloading azure_mgmt_search-8.0.0-py2.py3-none-any.whl (71 kB)
Collecting azure-mgmt-servicebus==7.1.0
  Downloading azure_mgmt_servicebus-7.1.0-py2.py3-none-any.whl (539 kB)
Collecting azure-mgmt-sql==3.0.1
  Downloading azure_mgmt_sql-3.0.1-py2.py3-none-any.whl (912 kB)
Collecting azure-mgmt-storage==19.0.0
  Downloading azure_mgmt_storage-19.0.0-py2.py3-none-any.whl (1.8 MB)
Collecting azure-mgmt-trafficmanager==1.0.0b1
  Downloading azure_mgmt_trafficmanager-1.0.0b1-py2.py3-none-any.whl (49 kB)
Collecting azure-mgmt-web==6.1.0
  Downloading azure_mgmt_web-6.1.0-py3-none-any.whl (3.9 MB)
Collecting azure-nspkg==2.0.0
  Downloading azure_nspkg-2.0.0-py2.py3-none-any.whl (2.6 kB)
Collecting azure-storage-blob==12.13.0
  Downloading azure_storage_blob-12.13.0-py3-none-any.whl (377 kB)
Collecting azure-core==1.28.0
  Downloading azure_core-1.28.0-py3-none-any.whl (185 kB)
Collecting azure-keyvault==4.2.0
  Downloading azure_keyvault-4.2.0-py2.py3-none-any.whl (4.3 kB)
Collecting azure-mgmt-keyvault==10.0.0
  Downloading azure_mgmt_keyvault-10.0.0-py3-none-any.whl (489 kB)
Collecting azure-mgmt-cosmosdb==9.5.1
  Downloading azure_mgmt_cosmosdb-9.5.1-py3-none-any.whl (387 kB)
Collecting azure-mgmt-hdinsight==9.0.0
  Downloading azure_mgmt_hdinsight-9.0.0-py2.py3-none-any.whl (125 kB)
Collecting azure-mgmt-devtestlabs==9.0.0
  Downloading azure_mgmt_devtestlabs-9.0.0-py2.py3-none-any.whl (238 kB)
Collecting azure-mgmt-loganalytics==12.0.0
  Downloading azure_mgmt_loganalytics-12.0.0-py2.py3-none-any.whl (146 kB)
Collecting azure-mgmt-automation==1.0.0
  Downloading azure_mgmt_automation-1.0.0-py2.py3-none-any.whl (287 kB)
Collecting azure-mgmt-iothub==3.0.0
  Downloading azure_mgmt_iothub-3.0.0-py3-none-any.whl (1.3 MB)
Collecting azure-iot-hub==2.6.1
  Downloading azure_iot_hub-2.6.1-py2.py3-none-any.whl (102 kB)
Collecting azure-mgmt-recoveryservices==2.0.0
  Downloading azure_mgmt_recoveryservices-2.0.0-py2.py3-none-any.whl (79 kB)
Collecting azure-mgmt-recoveryservicesbackup==3.0.0
  Downloading azure_mgmt_recoveryservicesbackup-3.0.0-py2.py3-none-any.whl (422 kB)
Collecting azure-mgmt-notificationhubs==7.0.0
  Downloading azure_mgmt_notificationhubs-7.0.0-py2.py3-none-any.whl (47 kB)
Collecting azure-mgmt-eventhub==10.1.0
  Downloading azure_mgmt_eventhub-10.1.0-py3-none-any.whl (598 kB)
ERROR: Cannot install azure-mgmt-network==19.1.0 and azure-mgmt-network==26.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested azure-mgmt-network==19.1.0
    The user requested azure-mgmt-network==26.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

An error occurred (rc=1), see output line(s) above for details.

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

If I understand it correctly we need to use dev branch of azure.collection to be able to install azure-mgmt-network==26.0.0. Otherwise it forces version 19.1.0 of azure-mgmt-network which is a dependency for azure.collection version 2.7.0, correct?
But ansible-builder cannot reach dev azure.collection from ansible galaxy.

@Fred-sun
Copy link
Collaborator

@khain0 From your execution log, it is very strange why you installed requirements.txt twice, Moreover, the two versions of the installation are not the same. The versions of azure-mgmt-network are v19.1.0 and v26.0.0, and the two versions conflict, resulting in the installation failure. Thank you!

“[3/4] STEP 13/14:  RUN $PYCMD /output/scripts/introspect.py introspect --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt  --write-pip=/tmp/src/requirements.txt”

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

The requirements are not installed twice.
Ansible-builder reads requirements from requirements.txt and prepares a temporary file under /tmp/src/requirements.txt to be reachable from inside the image.
I guess the requirements with azure-mgmt-network v19.1.0 comes from azure collection itself.

- 'azure-mgmt-network==19.1.0  # from collection azure.azcollection'

The question is how to omit this behavior?

@p3ck
Copy link
Collaborator

p3ck commented Oct 11, 2024

Hello,

I can provide some info on how ansible-builder works. When a galaxy requirement is specified the build process will look for the requirements.txt in each ansible module and use that for the python requirements. This makes sense since the ansible module would not be usable without the python dependencies.

As you have noticed that adding an additional requirements.txt to the ansible-builder will not remove the one provided by the ansible module, in this case the requirements.txt that were released with azure-collection-2.7.0.

The only way around this would be to rebuild the galaxy file and use a local version:

ansible-galaxy collection download azure.azcollection
cd $HOME/collections
mkdir azure-azcollection-2.7.0
cd azure-azcollection-2.7.0
tar xvf ../azure-azcollection-2.7.0.tar.gz
vi requirements.txt  # Update the azure-mgmt-network version
tar zcvf ../azure-azcollection-2.7.1.tar.gz .
# Copy this file to your mycollections directory under the directory where your execution-environment.yml lives

snippet from execution environment:

additional_build_files:
  - src: mycollections
    dest: mycollections

requirements.yml

---
collections:
  - source: mycollections/azure-azcollection-2.7.1.tar.gz
    type: file

I hope this helps and hopefully we have a 3.0.0 release of azure-ansible soon.

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

I perform all the steps you mentioned and I changed MANIFEST.json to 2.7.1 before making new tarball.
An error while building is:

[2/4] STEP 12/13: RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"
ERROR! Collection at 'collections/azure-azcollection-2.7.1.tar.gz' does not contain the required file MANIFEST.json.
[3/4] STEP 1/14: FROM 864238031742bc114eedb2466d453c8bea4baa8efe9b661b3772cff2cb49a00f AS builder
[3/4] STEP 2/14: ENV PIP_BREAK_SYSTEM_PACKAGES=1
Error: building at STEP "RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"": while running runtime: exit status 1

The same error is thrown when trying to install the collection:

ansible-galaxy collection install ./collections/azure-azcollection-2.7.1.tar.gz
ERROR! Collection at './collections/azure-azcollection-2.7.1.tar.gz' does not contain the required file MANIFEST.json

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

Checksum for download azure collection version 2.7.0:

sha256sum azure-azcollection-2.7.0.tar.gz
04291da6bf88eb4fe8068be070e8a1e3dd922e97a37ba9d3d42ac6c0e9a75c67  azure-azcollection-2.7.0.tar.gz

@p3ck
Copy link
Collaborator

p3ck commented Oct 11, 2024

Oops, I'm sorry. I forgot that it's a special format tarball that needs to be created with ansible-galaxy.

cd $HOME/collections/azure-azcollection-2.7.0
wget https://raw.githubusercontent.com/ansible-collections/azure/refs/heads/dev/galaxy.yml
vi galaxy.yml # Edit the version from 2.7.0 to 2.7.1
ansible-galaxy collection build 

You will now have the new collection in the current directory which you can copy to your execution environment build dir.

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

It wants me to have dnf in my image.

+ /usr/bin/dnf clean all
/output/scripts/assemble: line 163: /usr/bin/dnf: No such file or directory
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 127

Unfortunately I do not figured out how to use build_image in yaml version 3 which could contain dnf command

---
version: 3

dependencies:
  galaxy: ./requirements.yml
  python: ./requirements.txt

images:
  base_image:
    name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest
    # build_image:
    #name: registry.redhat.io/ansible-automation-platform-24/ansible-builder-rhel8:latest

additional_build_files:
  - src: collections
    dest: collections

additional_build_steps:
  prepend_base:
    # User configuration, using ansible key to allow write
    - COPY ansible.cfg /home/runner/.ansible.cfg
    - COPY id_ansible /home/runner/.ssh/id_ansible
    - RUN chmod 600 /home/runner/.ssh/id_ansible

@p3ck
Copy link
Collaborator

p3ck commented Oct 11, 2024

Add the following to your ee.yml

options:
  package_manager_path: /usr/bin/microdnf

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

I build the Execution Environment successfully and imported it to Ansible Automation Platform.
I run the playbook

- name: Get facts for a virtual network.
  azure_rm_virtualnetwork_info:
    resource_group: "{{ azure_spoke_vnet_resource_group }}"
    name: '{{ azure_spoke_vnet_name }}'
    client_id: '{{ azure_clientid }}'
    secret: '{{ azure_secret }}'
    tenant: '{{ azure_tenant }}'
    subscription_id: '{{ azure_subscription_id }}'
    cloud_environment: "{{ azure_config[ azure_resource_location ]['cloud_environment'] }}"

but it thorws an error:

exception": "Traceback (most recent call last):\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_nlx5k1bb/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 282, in <module>\n    from azure.mgmt.datalake.store import DataLakeStoreAccountManagementClient\nModuleNotFoundError: No module named 'azure.mgmt.datalake'\n",
  "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on 77f880cd19e9's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter",
  "invocation": {

@p3ck
Copy link
Collaborator

p3ck commented Oct 11, 2024

I think you may be missing some additional pieces

dependencies:
  python_interpreter:
    package_system: python39
    python_path: /usr/bin/python3.9

  ansible_core:
    package_pip: ansible-core==2.15

  ansible_runner:
    package_pip: ansible-runner==2.2.1   # install from PyPI

  galaxy: requirements.yml

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

I added the following to requirements.txt:

azure.mgmt.datalake.store==0.5.0

I get the error:

{
  "module_stdout": "",
  "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",
  "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1728663234.033851-58-233142354629519/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload__7vh34hr/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",
  "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
  "rc": 1,
  "_ansible_no_log": false,
  "changed": false
}

@p3ck
I try what you suggested now

@khain0
Copy link
Author

khain0 commented Oct 11, 2024

I use requirements.txt from https://github.com/ansible-collections/azure/blob/dev/requirements.txt and added:

azure.mgmt.datalake.store==0.5.0

Seems you are missing one module in your requirements.txt in dev branch
My yml file looks like this:

---
version: 3

dependencies:
  galaxy: ./requirements.yml
  python: ./requirements.txt
  python_interpreter:
    package_system: python39
    python_path: /usr/bin/python3.9
  ansible_core:
    package_pip: ansible-core==2.15

  ansible_runner:
    package_pip: ansible-runner==2.2.1   # install from PyPI

images:
  base_image:
    name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest
    # build_image:
    #name: registry.redhat.io/ansible-automation-platform-24/ansible-builder-rhel8:latest

additional_build_files:
  - src: collections
    dest: collections

additional_build_steps:
  prepend_base:
    # User configuration, using ansible key to allow write
    - COPY ansible.cfg /home/runner/.ansible.cfg
    - COPY id_ansible /home/runner/.ssh/id_ansible
    - RUN chmod 600 /home/runner/.ssh/id_ansible
options:
  package_manager_path: /usr/bin/microdnf

Execution Environment was built successfully.
Piece of playbook which throws an error:

- name: Get facts for a virtual network.
  azure_rm_virtualnetwork_info:
    resource_group: "{{ azure_spoke_vnet_resource_group }}"
    name: '{{ azure_spoke_vnet_name }}'
    client_id: '{{ azure_clientid }}'
    secret: '{{ azure_secret }}'
    tenant: '{{ azure_tenant }}'
    subscription_id: '{{ azure_subscription_id }}'
    cloud_environment: "{{ azure_config[ azure_resource_location ]['cloud_environment'] }}"

The error itself:

"module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",
  "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1728664548.0195312-58-112025827785989/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_8jfdvycj/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",

@Fred-sun
Copy link
Collaborator

@khain0 The code for the dev branch is up to date and aze-mgmt-network has been updated to v26.0.0 (relate PR #1697). So if you install azure.azcollection ==2.7.0, install requirment.txt in the package. File is located in the local directory ~ /. Ansible/collection/azure/azcollection/requirments. TXT.

In addition, the dev branch we will release as soon as possible, should be before the end of the month, will avoid this problem. Thank you!

@khain0
Copy link
Author

khain0 commented Oct 21, 2024

I build version 2.7.0 with the following requirements:

packaging
requests[security]
xmltodict
msgraph-sdk==1.0.0
azure-cli-core==2.61.0
azure-common==1.1.11
azure-identity==1.16.1
azure-mgmt-authorization==2.0.0
azure-mgmt-apimanagement==3.0.0
azure-mgmt-batch==16.2.0
azure-mgmt-compute==30.6.0
azure-mgmt-cdn==13.1.1
azure-mgmt-containerinstance==9.0.0
azure-mgmt-core==1.4.0
azure-mgmt-containerregistry==9.1.0
azure-containerregistry==1.1.0
azure-mgmt-containerservice==31.0.0
azure-mgmt-datafactory==2.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-marketplaceordering==1.1.0
azure-mgmt-monitor==3.0.0
azure-mgmt-managedservices==6.0.0
azure-mgmt-managementgroups==1.0.0
azure-mgmt-network==19.1.0
azure-mgmt-nspkg==2.0.0
azure-mgmt-privatedns==1.0.0
azure-mgmt-redis==13.1.0
azure-mgmt-resource==21.1.0
azure-mgmt-rdbms==10.2.0b12
azure-mgmt-search==8.0.0
azure-mgmt-servicebus==7.1.0
azure-mgmt-sql==3.0.1
azure-mgmt-storage==19.0.0
azure-mgmt-trafficmanager==1.0.0b1
azure-mgmt-web==6.1.0
azure-nspkg==2.0.0
azure-storage-blob==12.13.0
azure-core==1.28.0
azure-keyvault==4.2.0
azure-mgmt-keyvault==10.0.0
azure-mgmt-cosmosdb==9.5.1
azure-mgmt-hdinsight==9.0.0
azure-mgmt-devtestlabs==9.0.0
azure-mgmt-loganalytics==12.0.0
azure-mgmt-automation==1.0.0
azure-mgmt-iothub==3.0.0
azure-iot-hub==2.6.1;platform_machine=="x86_64"
azure-mgmt-recoveryservices==2.0.0
azure-mgmt-recoveryservicesbackup==3.0.0
azure-mgmt-notificationhubs==7.0.0
azure-mgmt-eventhub==10.1.0

I substitute version 2021-03-01 with 2021-04-01 under /usr/share/ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py
I create an image based on that, but I am still getting an error:

"module_stderr": "Traceback (most recent call last):\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2021_03_01/operations/_virtual_networks_operations.py\", line 214, in get\n    raise HttpResponseError(response=response, error_format=ARMErrorFormat)\nazure.core.exceptions.HttpResponseError: (InvalidApiVersionParameter) The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\nCode: InvalidApiVersionParameter\nMessage: The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\n",
  "exception": "Traceback (most recent call last):\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/runner/.ansible/tmp/ansible-tmp-1729517084.7977278-68-22581528654251/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_7kkz1xx6/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2021_03_01/operations/_virtual_networks_operations.py\", line 214, in get\n    raise HttpResponseError(response=response, error_format=ARMErrorFormat)\nazure.core.exceptions.HttpResponseError: (InvalidApiVersionParameter) The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\nCode: InvalidApiVersionParameter\nMessage: The api-version '2021-03-01' is invalid. The supported versions are '2024-08-01,2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.\n",

@Fred-sun
Copy link
Collaborator

Fred-sun commented Oct 22, 2024

@khain0 Yes, but the 'azure-mgmt-network' version installed in your environment is higher than v19.1.0, so you should have the latest dependency package installed. However, this did not match the version we requested for v19.1.0, which led to this error. Thank you!

@khain0
Copy link
Author

khain0 commented Oct 22, 2024

I don't get it. I have version 19.1.0 of azure-mgmt-network installed. Why you stated the version is higher than that?
If I understand the design correctly I need to install 2.7.0 and substitute values inside python script (e.g. 2021-03-01 with 2021-04-01) as it was done in PR https://github.com/ansible-collections/azure/pull/1697 , but somehow did not work.
If it is not possible to do it that why how can I build/download azure collection based on dev branch?

@khain0
Copy link
Author

khain0 commented Oct 22, 2024

@Fred-sun
I have bad news for you. I build collection from dev branch and the issue occurred again, so if version 3.0.0 of collection is going to be based on dev branch then the issue still persists.

raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01.

I guess something else have to be change to ensure compatible api version is used.

podman container run -it localhost/azure-dev:3.0 pip3 list |grep azure-mgmt-network
azure-mgmt-network                      26.0.0

 podman container run -it localhost/azure-dev:3.0 ansible-galaxy collection list

# /usr/share/ansible/collections/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 2.7.1
community.general  9.5.0

podman container run -it localhost/azure-dev:3.0 grep -B5 "2024-01-01" /usr/share/ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py
    def network_client(self):
        self.log('Getting network client')
        if not self._network_client:
            self._network_client = self.get_mgmt_svc_client(NetworkManagementClient,
                                                            base_url=self._cloud_environment.endpoints.resource_manager,
                                                            api_version='2024-01-01')
--
        self.log('Getting event hub client')
        if not self._event_hub_client:
            self._event_hub_client = self.get_mgmt_svc_client(
                EventHubManagementClient,
                base_url=self._cloud_environment.endpoints.resource_manager,
                api_version='2024-01-01')

Procedure to build collection from dev:

git clone https://github.com/ansible-collections/azure.git
cd azure
 git branch
* dev
sed -i 's/2.7.0/2.7.1/' galaxy.yml
ansible-galaxy collection build
[DEPRECATION WARNING]: [defaults]collections_paths option, does not fit var naming standard, use the singular form collections_path instead. This feature will be removed from ansible-core in version 2.19.
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Created collection for azure.azcollection at /ansible_ee/azure-dev/collections/azure-azcollection-dev/azure/azure-azcollection-2.7.1.tar.gz
mv azure-azcollection-2.7.1.tar.gz /ansible_ee/azure-dev/collections/
cat requirements.yml
---
collections:
- name: community.general
- name: azure.azcollection
  source: collections/azure-azcollection-2.7.1.tar.gz
  type: file
cat azure-ee.yml
---
version: 3

dependencies:
  galaxy: ./requirements.yml
  python: ./requirements.txt
  python_interpreter:
    package_system: python39
    python_path: /usr/bin/python3.9

  ansible_core:
    package_pip: ansible-core==2.15

  ansible_runner:
    package_pip: ansible-runner==2.3.2

images:
  base_image:
    name: 'registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest'
  # build_image:
    #name: registry.redhat.io/ansible-automation-platform-24/ansible-builder-rhel8:latest
additional_build_files:
  - src: collections
    dest: collections

additional_build_steps:
  prepend_base:
    # User configuration, using ansible key to allow write
    - COPY ansible.cfg /home/runner/.ansible.cfg
    - COPY id_ansible /home/runner/.ssh/id_ansible
    - RUN chmod 600 /home/runner/.ssh/id_ansible
options:
  package_manager_path: /usr/bin/microdnf

@Fred-sun
Copy link
Collaborator

@khain0 This problem can be confirmed to be caused by version conflict. I am pushing forward the release of v3.0.0 as soon as possible, which should solve this problem. Thank you!

@Fred-sun
Copy link
Collaborator

@khain0 The azure.azcollection version v2.7.1 requires azure-mgmt-network version v19.1.0, thank you!

@khain0
Copy link
Author

khain0 commented Oct 24, 2024

@Fred-sun so why requirements.txt in dev branch contains azure-mgmt-network==26.0.0?

@Fred-sun
Copy link
Collaborator

@khain0 The Dev branch is the development version and has not been released yet, we will update the latest code to the dev branch and release it at intervals. Thank you!

@Fred-sun
Copy link
Collaborator

@khain0 Yes, the code in the dev branch specifies the API version 'v2024-01-01' thanks!

@Fred-sun
Copy link
Collaborator

@khain0 The latest version v3.0.0 has been released, can you try it again? Thanks!

@khain0
Copy link
Author

khain0 commented Nov 15, 2024

As I told you before the issue still persists even with version 3.0.0.
I double-checked and I am using Execution Environment with the newest collection:
image
Execution Environment in Ansible Automation Platform:
image

Ansible collection version and python inside container spawned from the image which acts as Execution Environment
image

The error itself:

"module_stdout": "",
  "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",
  "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1731656083.9692533-58-43897573182924/AnsiballZ_azure_rm_virtualnetwork_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_virtualnetwork_info', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 356, in <module>\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 352, in main\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 237, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 252, in exec_module\n  File \"/tmp/ansible_azure_rm_virtualnetwork_info_payload_i7g8ezeh/ansible_azure_rm_virtualnetwork_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py\", line 272, in get_item\n  File \"/usr/local/lib/python3.9/site-packages/azure/mgmt/network/_validation.py\", line 25, in wrapper\n    raise ValueError(\nValueError: 'virtual_networks' is not available in API version 2021-03-01. All valid API version are 2015-06-15, 2017-10-01, 2018-04-01, 2018-11-01, 2018-12-01, 2019-02-01, 2019-04-01, 2019-06-01, 2019-07-01, 2019-08-01, 2019-09-01, 2019-11-01, 2019-12-01, 2020-03-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-07-01, 2020-08-01, 2020-11-01, 2021-02-01, 2023-02-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.\n",
  "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
  "rc": 1,
  "_ansible_no_log": null,
  "changed": false

@Fred-sun
Copy link
Collaborator

@khain0 According to the information you provided, the version you installed is the latest (v3.0.0), because I saw that it was installed on the container, could you please help to make the following judgment?

First: What's the azure.azcolleciton and azure-mgmt-network versions installed on the container?

Second: Whether you have azure.azcolleciton and azure-mgmt-network installed locally. What is the version?

Third: Do you run the script on top of the container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority not a bug Not a bug question Further information is requested work in In trying to solve, or in working with contributors
Projects
None yet
Development

No branches or pull requests

3 participants