Try converting it to YAML using ansible-inventory itself:

ansible-inventory -i inventory.ini --list --yaml --export

I think you probably want something like this:

all:
  hosts:
    localhost: {}
  children:
    foo_group:
      children:
        my_group_name:
          hosts:
            myhost: {}
          vars:
            my_var: foo


On Thu, Apr 30, 2020 at 11:57 AM Tdev Feeds <[email protected]> wrote:

> I'm converting our existing INI inventory to YAML. The reason is that I
> cannot seem to get variables like "{{ myvar }}" working within an INI
> inventory and have found no documentation that says INI format supports
> variables.
>
> Now, we have a group defined as "DEV". This worked in the INI format.
> HOWEVER, it causes errors in YAML format.
>
> all:
>   hosts:
>     localhost:
>   children:
>     foo_group:
>       children:
>         my_group_name:
> my_group_name:
>   hosts:
>     myhost:
>   vars:
>     my_var: foo
>
> In the example above, if I change "my_group_name" to "DEV" or "dev", I
> get the following error.
>
> ERROR! Attempting to decrypt but no vault secrets found
>
> I'm verifying the inventory using the following command.
>
> $ ansible-inventory -i inventory.yml --list
>
> Is this a bug or a reserved word? Why would it work in INI and not YAML?
>
> Thanks in advance.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-devel/c5af9291-9998-4073-9ca4-53508270031a%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-devel/c5af9291-9998-4073-9ca4-53508270031a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CAD8N0v9U7Pp9x%2BSVFtPsFPbeQaX-JF9mwHgA57UV19OwuUSsBg%40mail.gmail.com.

Reply via email to