# Solution for "Unable to parse /tmp/inventory\*\*\*.ini as an inventory source" error in anisble playbook

**URL:** <https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226>\
**Category:** Get Help\
**Tags:** ansible\
**Created:** [February 12, 2025, 6:26pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226 "2025-02-12T18:26:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjvignesh](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gjvignesh/32/7576_2.png) [@gjvignesh](https://forum.ansible.com/u/gjvignesh)\
**Post date:** [February 12, 2025, 6:26pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/1 "2025-02-12T18:26:36Z")

</div>

I am running ansible 2.9.10 version in CentOS Linux 7 server. Below are the parameters enabled in ansible.cfg file.

```auto
remote_tmp = /tmp
allow_world_readable_tmpfiles = True

```

I trigger ansible playbook my jenkins instance (2.452.1 version) and there are times (intermittent), I get error “Unable to parse /tmp/inventory\*\*\*.ini as an inventory source”. During this error I see /tmp filesystem has sufficient space.  
When other jobs are succeeding and also if the same job is retriggered against same target server it is succeeding.  
In this case, what could be the reason for this error? How to prevent this error?

---

<div class="post-metadata">

**Author:** ![isaiahmking](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/isaiahmking/32/7536_2.png) [@isaiahmking](https://forum.ansible.com/u/isaiahmking)\
**Post date:** [February 12, 2025, 11:23pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/2 "2025-02-12T23:23:36Z")

</div>

Hi!, I remember reading of a similar error regarding jenkins while doing some reaserch, (although I can’t seem to find the exact place I read it 😅)

however, I remember the issue revolved around jenkins using unique environments per execution which can affect file availibility/permissions. The kicker was that It was subjective as no job is the same; so it’s almost unpredictable!

I don’t know of an _official_ solution currently (I’ll try to get back to you) but off the top of my head, one solution could be to set a unique directory, but that opens doors to other permission problems.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [February 13, 2025, 5:39pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/3 "2025-02-13T17:39:12Z")

</div>

First, those settings are unrelated to inventory, inventory is parsed at the controller, those are settings for remote module execution.

You should post the full warnings you got if you want help to narrow down the issue, just giving a partial message is not normally enough to diagnose any issue.

---

<div class="post-metadata">

**Author:** ![gjvignesh](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gjvignesh/32/7576_2.png) [@gjvignesh](https://forum.ansible.com/u/gjvignesh)\
**Post date:** [February 14, 2025, 12:04pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/4 "2025-02-14T12:04:30Z")

</div>

This is my exact error message from ansible playbook output,

[WARNING]: Unable to parse /tmp/inventory\*\*\*.ini as an inventory source  
[WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the  
implicit localhost does not match ‘all’

I had mentioned a host “hostxxx” as ansible inventory in my jenkins build and had used “hosts: all” in my ansible playbook. Since the inventory is not accessible the playbook fails with above mentioned error.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [February 14, 2025, 3:08pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/5 "2025-02-14T15:08:13Z")

</div>

Try running it with `-vvv` to see which inventory plugins tried to parse the inventory file.

It could be due to file permissions, for example:

```auto
$ ANSIBLE_INVENTORY_ENABLED=ini ansible-inventory -i /tmp/inventory.ini --list -vvv
ansible-inventory 2.9.10
  config file = /home/shertel/ansible/ansible.cfg
  configured module search path = ['/home/shertel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/shertel/ansible/lib/ansible
  executable location = /home/shertel/ansible/bin/ansible-inventory
  python version = 3.11.4 (main, Jun 7 2023, 00:00:00) [GCC 13.1.1 20230511 (Red Hat 13.1.1-2)]
Using /home/shertel/ansible/ansible.cfg as config file
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /tmp/inventory.ini as it did not pass its verify_file() method
[WARNING]: Unable to parse /tmp/inventory.ini as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
    "_meta": {
        "hostvars": {}
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    }
}

```

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [February 14, 2025, 4:43pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/6 "2025-02-14T16:43:18Z")

</div>

You should have a warning per inventory plugin enabled, so unless you disabled all inventory plugins, there should be more warnings.

You should also add the output of `ansible-config dump --only-changed -t all`

P.S. if you did disable all inventory plugins … well, that is the reason inventory doesn’t work.

---

<div class="post-metadata">

**Author:** ![gjvignesh](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gjvignesh/32/7576_2.png) [@gjvignesh](https://forum.ansible.com/u/gjvignesh)\
**Post date:** [February 21, 2025, 1:53pm UTC](https://forum.ansible.com/t/solution-for-unable-to-parse-tmp-inventory-ini-as-an-inventory-source-error-in-anisble-playbook/40226/7 "2025-02-21T13:53:58Z")

</div>

@shertel  
Thank you, Since the issue is intermittent, i will post the debug output during next error occurence.
