Skip to content

trellis logs for lima vm #511

@lukasbesch

Description

@lukasbesch

Summary

trellis logs development should adjust (omit) the ssh user automatically when using lima.

At the moment, the ssh user is hardcoded to vagrant when the environment is development:
https://github.com/roots/trellis-cli/blob/master/trellis/ssh.go#L10-L11

It should be possible to detect vagrant or lima automatically in most cases (by looking into the .trellis directory).
If both vagrant and lima configuration is present, it probably should assume vagrant (backwards compatible).
Possibly an additional command trellis vm logs would make sense for this edge case.

Additional context

Output when running trellis logs development:

Running command => ssh vagrant@example.test tail -f /srv/www/example/logs/*[^gz]?
vagrant@example.test: Permission denied (publickey).
Error running ssh: exit status 255

Command needed to get the logs:

ssh example.test "tail -f /srv/www/example/logs/*[^gz]?"

Or enter the vm using trellis vm shell and tail from inside.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions