# Manually install collection on airgapped system

**URL:** <https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825>\
**Category:** Get Help\
**Tags:** collections, galaxy-ng\
**Created:** [October 20, 2023, 6:32am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825 "2023-10-20T06:32:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bor](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bor/32/1258_2.png) [@Bor](https://forum.ansible.com/u/Bor)\
**Post date:** [October 20, 2023, 6:32am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/1 "2023-10-20T06:32:01Z")

</div>

I would like to use the ansible.posix collection in my projects. I have been reading ansible docs, searching these forums and searching the internet, but I cannot seem to figure out what is going wrong. I am using this as my ansible.cfg:

```auto
[defaults]
inventory = ./inventory.ini
library = ./modules
roles_path = ./roles
collections_path = ./collections
interpreter_python = auto_silent
gathering = smart
host_key_checking = False
stdout_callback = debug
callback_whitelist = timer, profile_roles
# SSH timeout
timeout = 10
log_path = ../../ansible.log
deprecation_warnings = True
retry_files_enabled = False

```

I have done the following to install the collection:

- Downloaded the tarball
- extracted to a temp dir
- created `./collections/ansible-collections/community` dir in my project dir (next to my playbook)
- moved `ansible.posix` dir below the `community` dir. This dir holds the `docs`, `meta`, `plugins` dir (amongst the other content of course)

I create a playbook and call the collection as follows:

```auto
    - name: Set authorized key taken from file
      ansible.posix.authorized_key:

```

The error appears:

```auto
ERROR! couldn't resolve module/action 'ansible.posix.authorized_key'. This often indicates a misspelling, missing collection, or incorrect module path.

```

I moved the ansible.posix to:

- ./collections
- ./collections/ansible-collections/

But I keep getting this error. I tried different modules like `ansible.posix.mount`, it’s another one I’d like to use but it throws the same error.

I’m sure it must be something silly, but I don’t see what I’m doing wrong here?

Any help please?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Torie-Coding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/torie-coding/32/1248_2.png) [@Torie-Coding](https://forum.ansible.com/u/Torie-Coding)\
**Post date:** [October 20, 2023, 8:10am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/2 "2023-10-20T08:10:17Z")

</div>

Hey, do you have tryed the FQCN in your playbook?

---

<div class="post-metadata">

**Author:** ![Bor](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bor/32/1258_2.png) [@Bor](https://forum.ansible.com/u/Bor)\
**Post date:** [October 20, 2023, 8:16am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/3 "2023-10-20T08:16:54Z")

</div>

> [@Torie-Coding](#):
>
> FQCN

Thanks.

That wasn’t the complete playbook, just the play that calls the module.

The playbook looks like this:

```auto
---
- hosts: name_as_specified_in_inventory
  gather_facts: true
  become: false
  tasks:
    - name: etc

```

With other plays and built-in modules the playbook runs correctly. Hosts are reachable.

---

<div class="post-metadata">

**Author:** ![Torie-Coding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/torie-coding/32/1248_2.png) [@Torie-Coding](https://forum.ansible.com/u/Torie-Coding)\
**Post date:** [October 20, 2023, 8:20am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/4 "2023-10-20T08:20:17Z")

</div>

I’ll test it myself and report back

---

<div class="post-metadata">

**Author:** ![Torie-Coding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/torie-coding/32/1248_2.png) [@Torie-Coding](https://forum.ansible.com/u/Torie-Coding)\
**Post date:** [October 20, 2023, 8:54am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/5 "2023-10-20T08:54:31Z")

</div>

Hey, so i tried it and for me it works.

Your `collections_paths` is set correct but your directory structure seems wrong.  
It should be `collections/ansible_collections/<namespace>/<module>`.  
in your case it should be `collections/ansible_collections/ansible/posix`

when you now try your playbook and give it a go with -vvv you see the collection path it uses: `Using module file <my_dir>/collections/ansible_collections/ansible/posix/plugins/modules/authorized_key.py`

also please dont extract the tar.gz your self thats seems laborious. Instead use ansible: `ansible-galaxy collection install ansible-posix-1.5.4.tar.gz -p ./collections` that way you get a correct directory structure.

please let me know if this works for you 🙂

Best Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 19, 2023, 8:55am UTC](https://forum.ansible.com/t/manually-install-collection-on-airgapped-system/1825/6 "2023-11-19T08:55:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
