roots / trellis-cli

A CLI to manage Trellis projects
https://roots.io/trellis/
MIT License
166 stars 25 forks source link

Bug: trellis vault edit staging "no such file" #356

Closed cspicuzza closed 1 year ago

cspicuzza commented 1 year ago

Terms

Description

What's wrong?

trellis vault edit staging throws an error

What have you tried?

trellis vault view staging -> works trellis vault edit staging -> fails

What insights have you gained?

I can edit the file with ansible-vault edit group_vars/staging/vault.yml

Possible solutions

Temporary workarounds

Steps To Reproduce

  1. Install Trellis using the cli
  2. configure group_vars
  3. trellis vault encrypt
  4. trellis vault edit staging

Expected Behavior

I expected to be able to edit my vault file

Actual Behavior

[Errno 2] No such file or directory: '/Users/**/Development/***.com/trellis/staging'

Relevant Log Output

No response

Versions

trellis cli 1.9.0

swalkinshaw commented 1 year ago

This isn't technically a bug because it's the expected and documented behaviour. This command requires a file path, not an environment name:

trellis vault edit
Error: missing arguments (expected exactly 1, got 0)

Usage: trellis vault edit [options] FILE

Edit an encrypted file in place

Trellis docs: https://docs.roots.io/trellis/master/vault/
Ansible Vault docs: https://docs.ansible.com/ansible/latest/user_guide/vault.html

Edit production file:

  $ trellis vault edit group_vars/production/vault.yml

Arguments:
  FILE file name to edit

Options:
  -h, --help  show this help

However, right now the vault commands have a few inconsistencies and I agree it ideally should work this way. But there are differences with edit that make it a bit harder.

I'm leaving this open since I'm going to try and make all the vault commands more consistent.

cspicuzza commented 1 year ago

That makes sense. Sorry for reporting a non-bug