Problem with ansible collection

713 views
Skip to first unread message

dawid.grygrzc

unread,
Aug 18, 2023, 10:20:19 AM8/18/23
to AWX Project
Hi all!
I want to use the 'community.general.ipmi_power' module which is included in the 'community.general' collection.

After updating my gitlab repository I am not able to sync my project (always failed).
Do you have any ideas?

Logs output:
PLAY [Update source tree if necessary] *****************************************

TASK [Update project using git] ************************************************
ok: [localhost]

TASK [Set the git repository version] ******************************************
ok: [localhost]

TASK [Repository Version] ******************************************************
ok: [localhost] => {
    "msg": "Repository Version 0fa920ca1c22a5e89cce085de031d156686d77be"
}

PLAY [Perform project signature/checksum verification] *************************

PLAY [Install content with ansible-galaxy command if necessary] ****************

TASK [Warn about disabled content sync] ****************************************
skipping: [localhost]

TASK [End play due to disabled content sync] ***********************************
skipping: [localhost]

TASK [Fetch galaxy roles from roles/requirements.(yml/yaml)] *******************
[WARNING]: Unable to find
'/var/lib/awx/projects/_19__awx_cleanup_playbooks/roles' in expected paths (use
-vvvvv to see paths)
skipping: [localhost]

TASK [Fetch galaxy collections from collections/requirements.(yml/yaml)] *******
failed: [localhost] (item=/var/lib/awx/projects/_19__awx_cleanup_playbooks/collections/requirements.yml) => {"ansible_loop_var": "item", "changed": true, "cmd": ["ansible-galaxy", "collection", "install", "-r", "/var/lib/awx/projects/_19__awx_cleanup_playbooks/collections/requirements.yml"], "delta": "0:03:01.363336", "end": "2023-08-18 13:47:51.748764", "item": "/var/lib/awx/projects/_19__awx_cleanup_playbooks/collections/requirements.yml", "msg": "non-zero return code", "rc": 1, "start": "2023-08-18 13:44:50.385428", "stderr": "[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected\\nerror when getting available versions of collection community.general: Unknown\\nerror when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':\\n<urlopen error [Errno 99] Cannot assign requested address>. <urlopen error\\n[Errno 99] Cannot assign requested address>\\nERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error [Errno 99] Cannot assign requested address>. <urlopen error [Errno 99] Cannot assign requested address>", "stderr_lines": ["[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected", "error when getting available versions of collection community.general: Unknown", "error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':", "<urlopen error [Errno 99] Cannot assign requested address>. <urlopen error", "[Errno 99] Cannot assign requested address>", "ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error [Errno 99] Cannot assign requested address>. <urlopen error [Errno 99] Cannot assign requested address>"], "stdout": "Starting galaxy collection install process\\nProcess install dependency map", "stdout_lines": ["Starting galaxy collection install process", "Process install dependency map"]}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0   



tree output:
.
├── collections
│   └── requirements.yml
├── README.md
└── reset_bmc.yml


requirements.yml output:
---
collections:
- name: community.general
  source: https://galaxy.ansible.com


reset_bmc.yml output:
---
- name: Power off bare metal using IPMI
  hosts: all
  gather_facts: no

  tasks:

    - name: Power On the Server
      community.general.ipmi_power:
        hostname: hostname
        username: login
        password: pass
        state: off
      delegate_to: localhost



AWX Project

unread,
Aug 25, 2023, 1:16:52 PM8/25/23
to AWX Project
Are you able connect (curl) https://galaxy.ansible.com from inside the task container?

kubectl exec -it deploy/awx-task -c awx-task -- bash

what if you leave off "source" in the requirements.yml file (should default to galaxy)? does it work then?

AWX Team

dawid.grygrzc

unread,
Aug 28, 2023, 6:31:22 AM8/28/23
to AWX Project
Hi,
The problem has been solved by adding HTTP_PROXY, HTTPS_PROXY, NO_PROXY in Settings>Job> Environment Variables for Galaxy Commands.
After that projects syncs successfully.

Reply all
Reply to author
Forward
0 new messages