I don't think what you're doing is expected to work.
*ansible_ssh_private_key_file* is the path to a private key file used by 
ssh. That you happen to point it at a file in *{{inventory_dir}}/group_vars* 
doesn't somehow make ssh able to decrypt ansible-vault encrypted files.

On Sunday, October 2, 2022 at 7:15:34 AM UTC-4 [email protected] wrote:

> I'm using in inventory/group_vars/all.yaml:
> ....
> *ansible_ssh_private_key_file: '{{inventory_dir}}/group_vars/path/to/key'*
>
> This Key is working well when it's plain text
> When I encrypt the file with ansible-vault, i get the error:
>
>
>
> *    Load key 
> "/home/user/projects/ansible/inventory/group_vars/path/to/key": invalid 
> format    root @ SOME_IP: Permission denied (publickey,password).  
> unreachable: true*
>
> I am using $*ANSIBLE_VAULT_PASSWORD_FILE *to decrypt everything without 
> asking for password.
> I have other encrypted secrets in all.yaml that get decrypted.
>
> What am I missing ?
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" 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-project/34ffe093-d35c-41d3-9579-90aed8540ce8n%40googlegroups.com.

Reply via email to