ansible / galaxy_collection

Collection of modules and roles to configure Automation Hub
GNU General Public License v3.0
57 stars 55 forks source link

Repository role has arg validation errors #339

Closed kbreit-insight closed 10 months ago

kbreit-insight commented 10 months ago

Summary

When running the infra.ah_configuration.repository role the execution fails with invalid arguments. It's saying ah_repositories is invalid but the documentation says that's what it should be. I did see https://github.com/ansible/galaxy_collection/blob/e5eb1e99fe323417a88d16ed8083a77a4a89db4e/roles/repository/meta/argument_specs.yml#L3 does not include ah_repositories.

Issue Type

Ansible, Collection, Private Automation Hub details

ansible [core 2.15.6]
  config file = /etc/ansible/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  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

# /usr/share/ansible/collections/ansible_collections
Collection                     Version
------------------------------ -------
ansible.posix                  1.5.4
ansible.utils                  2.11.0
awx.awx                        23.3.1
community.general              8.0.2
infra.ah_configuration         2.0.4
infra.controller_configuration 2.5.2

Private Automation Hub version: 4.6.6

OS / ENVIRONMENT

RHEL 8 with AAP 2.4

Desired Behavior

The playbook should execute the role correctly.

Actual Behavior

  "msg": "Validation of arguments failed:\nah_repositories. Supported parameters include: ah_configuration_async_dir, ah_configuration_repository_secure_logging, ah_configuration_secure_logging, ah_host, ah_password, ah_path_prefix, ah_repository_certified, ah_repository_community, ah_request_timeout, ah_token, ah_username, ah_validate_certs, proxy_password, proxy_url, proxy_username.",

STEPS TO REPRODUCE

  roles:
    - role: infra.ah_configuration.repository
      ah_repository_community:
        url: https://galaxy.ansible.com/api/
        requirements_file: '{{ lookup("ansible.builtin.file", "files/requirements.yaml") }}'
Tompage1994 commented 10 months ago

As per the changelog, there was a breaking change in v2.0.0 of this collection where the repository role was changed to accept ah_repositories as a list:

breaking_changes:
      - Update collection repository roles to use allow for lists (you now need to
        have a name for each repo and update the variable name) as this has been expanded
        in the newer version of the product.

If you are using AAP2.4 it is recommended to begin using the collection_remote modules and roles instead.

That said, I will create a new issue to tidy up the arg_spec for the role, however the readme is already correct.

It also looks like you have a syntax error with your example as the variable should be under a vars option under the role.