#  Ansible-vault correct set up

**URL:** <https://forum.ansible.com/t/ansible-vault-correct-set-up/46185>\
**Category:** Get Help\
**Tags:** ubuntu\
**Created:** [August 18, 2026, 3:13pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185 "2026-08-18T15:13:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rendex](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rendex/32/11055_2.png) [@Rendex](https://forum.ansible.com/u/Rendex)\
**Post date:** [August 18, 2026, 3:13pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/1 "2026-08-18T15:13:26Z")

</div>

Hi everyone, I just need some help regarding Ansible Vault. My `.ini` inventory is currently encrypted with Ansible Vault, but after running it in the Rundeck GUI, I encountered an error. Here is the error:

[WARNING]: \* Failed to parse /opt/ansible-lab/inventories/ubuntu.ini with ini

plugin: /opt/ansible-lab/inventories/ubuntu.ini:5: Error parsing host

definition 'w?"Մ???b?%0???8????q[???:$?u]:A?hP??f?3̥?Xp?Tn[???v??u?D3??

?2X  
D?8#(мB?^0??)?D?m???k?)???ϯ?B?Ze?8S1w?W?R?BV???'gfB?-+¾d??A?4?B?

J  
?C’: No closing quotation

[WARNING]: Unable to parse /opt/ansible-lab/inventories/ubuntu.ini as an

inventory source

[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: Could not match supplied host pattern, ignoring: ubuntu\_servers

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [August 18, 2026, 3:26pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/2 "2026-08-18T15:26:42Z")

</div>

The INI format file for Ansible inventory cannot be vaulted, nor does it support inline encrypted vault strings. Instead, use a directory structure where your plain `inventory.ini` file sits next to a `group_vars/` or `host_vars/` folder containing encrypted YAML vault files.

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [August 18, 2026, 5:19pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/3 "2026-08-18T17:19:41Z")

</div>

Just to add the relevant section from the docs:

[https://docs.ansible.com/projects/ansible/latest/vault\_guide/vault\_encrypting\_content.html#encrypting-files-with-ansible-vault](https://docs.ansible.com/projects/ansible/latest/vault_guide/vault_encrypting_content.html#encrypting-files-with-ansible-vault)

Apparently, you can even encrypt your HDD… but not the inventory file(s) 😆

---

<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:** [August 18, 2026, 6:31pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/4 "2026-08-18T18:31:00Z")

</div>

Vaulted inventory support depends on the inventory plugin itself. Plugins can choose to open the file with functions that support vaulted content, the `ini` inventory plugin does do this.

```auto
#>ansible-inventory -i ../testing/valutedini.ini --ask-vault-pass --list
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point.
Vault password: test
{
    "_meta": {
        "hostvars": {},
        "profile": "inventory_legacy"
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    },
    "ungrouped": {
        "hosts": [
            "host1",
            "host2"
        ]
    }
}

#>cat ../testing/valutedini.ini 
$ANSIBLE_VAULT;1.1;AES256
32383232653430383435373334393566333566633738336235303637613532383930313032356630
3932643561613133333362623762353133383330383234300a356237343637303666376639306161
36396434666463363831366162386462626630396539343437326138613736333363366162626161
3638623038393964340a353433303336373535356130373561653062656532393733666265663166
3236

```

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [August 18, 2026, 6:40pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/5 "2026-08-18T18:40:54Z")

</div>

Are you saying that the error the OP is getting is caused by something else? Vault encrypted `ini` inventory should work?

---

<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:** [August 18, 2026, 6:47pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/6 "2026-08-18T18:47:24Z")

</div>

Yes, at first i thought only the `yaml` plugin supported this, but then tested and realized we built this into the `ini` also. The error they are getting seem unrelated to ansible vault encryption and looks like a different encryption method.

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [August 18, 2026, 6:51pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/7 "2026-08-18T18:51:07Z")

</div>

That’s nice to know. Thanks!

Yeah, the binary looking output is a little bit fishy.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [August 19, 2026, 2:15pm UTC](https://forum.ansible.com/t/ansible-vault-correct-set-up/46185/8 "2026-08-19T14:15:16Z")

</div>

> [@utoddl](#):
>
> The INI format file for Ansible inventory cannot be vaulted,

I stand corrected. Following my father-in-law’s declaration: _“Often wrong; never in doubt.”_
