Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish servers by server-name, port and user in output #48

Closed
dwarfi09 opened this issue Dec 7, 2022 · 3 comments
Closed

Distinguish servers by server-name, port and user in output #48

dwarfi09 opened this issue Dec 7, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@dwarfi09
Copy link

dwarfi09 commented Dec 7, 2022

Is your feature request related to a problem? Please describe

When you access multiple hosts with the same hostname but different ports (e.g. running multiple virtualized servers on one host) you can't distinguish one from each other in the output.

config-example:

servers:
  VM1:
    host: root@server:22001
  VM2:
    host: user@server:22002
  VM3:
    host: root@server:22003

Running a task like an os-prober will create:

 host               | OS                                           
--------------------+----------------------------------------------
 server             | Debian 11                                    
 server             | Debian 10                                    
 server             | Debian 11                                    

The information about the different servernames, ports etc. is missing

Describe the solution you'd like

The output should (optionally) contain information about the server-name (VM1, VM2, VM3 in the example above) and / or port and username.

Additional context

./.

@dwarfi09 dwarfi09 added the enhancement New feature or request label Dec 7, 2022
@alajmo
Copy link
Owner

alajmo commented Dec 8, 2022

Yes, I have that feature on the roadmap, pretty much similar solution to the header prefix you can customize in themes (uses go templates so you can use conditionals):

themes:
    default:
        text:
            prefix: true
            header: '{{ .Style "TASK" "bold" }}{{ if ne .NumTasks 1 }} ({{ .Index }}/{{ .NumTasks }}){{end}}{{ if and .Name .Desc }} [{{.Style .Name "bold"}}: {{ .Desc }}] {{ else if .Name }} [{{ .Name }}] {{ else if .Desc }} [{{ .Desc }}] {{end}}'
        table:

I'll try to implement it this week.

@alajmo alajmo mentioned this issue Jan 1, 2023
@alajmo
Copy link
Owner

alajmo commented Jan 4, 2023

A bit late, but v0.14.0 now supports updating the prefix for text and table output:

themes:
  default:
    text:
      # Available variables: `.Name`, `.Index`, `.Host`, `.Port`, `.User`
      prefix: '{{.User}}@{{ .Host }}:{{.Port}}'

    table:
      # Available variables: `.Name`, `.Index`, `.Host`, `.Port`, `.User`
      prefix: '{{.User}}@{{ .Host }}:{{.Port}}'

Let me know if works!

@dwarfi09
Copy link
Author

dwarfi09 commented Jan 6, 2023

This solves the problem perfectly! Thank you :)

@alajmo alajmo closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants