List all ansible-vault encrypted files?

73 views
Skip to first unread message

Alicia Smith

unread,
Jan 28, 2017, 1:11:06 AM1/28/17
to Ansible Project
Is there a way to list all files in a repo that are encrypted via ansible-vault?

If there is I haven't figured it out yet. I've searched on google and everything just points to how to use view or edit.
I was hoping there was something like "ansible-vault status" that would list all files in the repo in one column and whether encrypted or not in a second column.
It would also help people automate figuring out which files are not encrypted that should be without having to read/view/edit/open every file. For example - all conf files should be encrypted. This would help confirm they are.

Just a thought, if there is no way of doing this currently, I'll submit an issue for it.

Thank you,

Alicia





Paul Tötterman

unread,
Jan 28, 2017, 6:05:17 AM1/28/17
to Ansible Project
Is there a way to list all files in a repo that are encrypted via ansible-vault?

grep -rl '$ANSIBLE_VAULT;1.1'

Look at the first line of an ansible vault encrypted file and play around a bit with the magic string

I also prefer to name my vault files ending in .vault.

Cheers,
Paul 

Johannes Kastl

unread,
Jan 28, 2017, 6:31:04 AM1/28/17
to ansible...@googlegroups.com
On 28.01.17 12:05 Paul Tötterman wrote:

> I also prefer to name my vault files ending in .vault.

Interesting thought. Is this just for your encrypted binary files, or
does this work with encrypted yml files, too?

Johannes (is off reading the docs)

signature.asc

Paul Tötterman

unread,
Jan 28, 2017, 6:32:41 AM1/28/17
to Ansible Project
Interesting thought. Is this just for your encrypted binary files, or
does this work with encrypted yml files, too?

What encrypted binary files ?-) I only have encrypted YAML files

Cheers,
Paul 

Johannes Kastl

unread,
Jan 28, 2017, 6:33:53 AM1/28/17
to ansible...@googlegroups.com
On 28.01.17 12:32 Paul Tötterman wrote:

> What encrypted binary files ?-) I only have encrypted YAML files

Nice. ;-)

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages