Unable to encrypt multiple files using trellis-cli

trellis vault encrypt is not allowing me to encrypt multiple files at a time using --files option it is showing error
Error: too many arguments (expected exactly 1, got 3)
when running

trellis vault encrypt --files=group_vars/all/vault.yml group_vars/development/vault.yml group_vars/staging/vault.yml group_vars/production/vault.yml

I wasn’t able to get it to take multiple arguments either.

You can just:

trellis vault encrypt development && trellis vault encrypt staging && trellis vault encrypt production

That took care of group_vars/all/vault.yml for me as well, but might want to double check particularly if you’ve added any sensitive information there.

1 Like

It may be a great idea to add this to the trellis-cli issue tracker:

Thanks, there are a few simple workarounds. Since this a line that is in the setup guide that no longer functions I thought it should be brought to attention but now I know there are better places for that :stuck_out_tongue: thanks @strarsis

My bad. After reading the source code, i realised my previous comment is incorrect.

Both of the following should work:

# Commas not spaces
$ trellis vault encrypt --files=group_vars/all/vault.yml,group_vars/development/vault.yml,group_vars/staging/vault.yml,group_vars/production/vault.yml

$ trellis vault encrypt development && trellis vault encrypt staging && trellis vault encrypt production

See: https://github.com/roots/trellis-cli/pull/179/files