'How do you list the versions of an Ansible Galaxy role using the ansible-galaxy command?

When I use "ansible-galaxy info author.role_name" I get substantial info, but not a list of previous versions.

On the website, each role has a nice list of previous versions, but when I use info, there's no version list:

[ansible@control]$ ansible-galaxy info geerlingguy.ansible

Role: geerlingguy.ansible
        description: Ansible for RedHat/CentOS/Debian/Ubuntu.
        active: True
        commit: 35546b1505fee7d9a0a8a4511540b7cc7a5da721
        commit_message: Switch to travis-ci.com.
        commit_url: https://api.github.com/repos/geerlingguy/ansible-role-ansible/git/commits/35546b1505fee7d9a0a8a4511540b7cc7a5da721
        company: Midwestern Mac, LLC
        created: 2014-06-07T16:22:42.972679Z
        download_count: 458857
        forks_count: 55
        github_branch: master
        github_repo: ansible-role-ansible
        github_user: geerlingguy
        id: 1007
        imported: 2020-10-28T00:30:53.480734-04:00
        is_valid: True
        issue_tracker_url: https://github.com/geerlingguy/ansible-role-ansible/issues
        license: license (BSD, MIT)
        min_ansible_version: 2.4
        modified: 2020-10-28T04:30:53.486945Z
        open_issues_count: 1
        path: ('/home/ansible/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansible/roles')
        role_type: ANS
        stargazers_count: 63
        travis_status_url: https://travis-ci.com/geerlingguy/ansible-role-ansible.svg?branch=master

Where do I find a list of previous versions of a role using the ansible-galaxy command line tool?



Solution 1:[1]

The closest I've come to solving this for the moment is to purposely request installing the WRONG version. This will give back an error message with detailed information of the available versions. I use grep to focus on the version information only.

Example:

ansible-galaxy role install geerlingguy.nginx,wrong 2>&1 | grep -o "'version': '[^']*'"

This yields:

'version': '1.0.0'
'version': '1.0.1'
'version': '1.1.1'
'version': '1.1.0'
...
'version': '3.0.0'
'version': '3.1.0'
'version': '3.1.1'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmed