ansibleansible-galaxy

Ansible install collection offline


I'm trying to install Ansible from a tar file, but I seem to face issue regarding that:

ansible-galaxy collection install azure-azcollection-1.10.0.tar.gz 

Ansible version is 2.10
00:03:08.902  [0mansible-galaxy 2.10.15
00:03:08.902    config file = None
00:03:08.902    configured module search path = ['/plugins/modules', '/ansible/library']
00:03:08.902    ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
00:03:08.902    executable location = /usr/local/bin/ansible-galaxy
00:03:08.902    python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Error I'm getting is:

0:03:25.896  [91m[0;31mERROR! Invalid collection name 'azure-azcollection-1.10.0.tar.gz', name must be in the format <namespace>.<collection>.

I followed this guide : https://www.redhat.com/sysadmin/install-ansible-disconnected-node

Any suggestions?


Solution

  • This is the error you will receive if you specify a file that does not exist.

    ec2-user@honest-nyoijizai ~ $ ansible-galaxy --version
    ansible-galaxy 2.10.15
      config file = None
      configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
      ansible python module location = /home/ec2-user/.local/lib/python3.7/site-packages/ansible
      executable location = /home/ec2-user/.local/bin/ansible-galaxy
      python version = 3.7.10 (default, Jun  3 2021, 00:02:01) [GCC 7.3.1 20180712 (Red Hat 7.3.1-13)]
    
    ec2-user@honest-nyoijizai ~ $ ansible-galaxy collection install azure-azcollection-1.10.1.tar.gz                                                                
    Starting galaxy collection install process
    Process install dependency map
    ERROR! Invalid collection name 'azure-azcollection-1.10.1.tar.gz', name must be in the format <namespace>.<collection>. 
    Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only.
    
    ec2-user@honest-nyoijizai ~ $ ansible-galaxy collection install azure-azcollection-1.10.0.tar.gz 
    Starting galaxy collection install process
    Process install dependency map
    Starting collection install process
    Installing 'azure.azcollection:1.10.0' to '/home/ec2-user/.ansible/collections/ansible_collections/azure/azcollection'
    azure.azcollection (1.10.0) was installed successfully