[WIP] v0.7.0 almost ready to release

This commit is contained in:
2025-02-08 15:17:34 -06:00
parent 8788d473a5
commit 11ec1a98d8
34 changed files with 556 additions and 196 deletions

View File

@ -8,7 +8,7 @@ import (
var (
hostExecCommand = &cobra.Command{
Use: "host [--commands=command1,command2, ... | -c command1,command2, ...] [--hosts=host1,hosts2, ... | -m host1,host2, ...] ",
Use: "host [--command=command1 --command=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -m host2 ...] ",
Short: "Runs command defined in config file on the hosts in order specified.",
Long: "Host executes specified commands on the hosts defined in config file.\nUse the --commands or -c flag to choose the commands.",
Run: Host,
@ -21,6 +21,10 @@ var cmdList []string
func init() {
hostExecCommand.Flags().StringArrayVarP(&hostsList, "hosts", "m", nil, "Accepts space-separated names of hosts.")
hostExecCommand.Flags().StringArrayVarP(&cmdList, "command", "c", nil, "Accepts space-separated names of commands.")
parseS3Config()
}
// cli input should be hosts and commands. Hosts are defined in config files.
@ -40,6 +44,7 @@ func Host(cmd *cobra.Command, args []string) {
}
// host is only checked when we read the SSH File
// so a check may not be needed here
// but we can check if the host is in the config file
for _, h := range hostsList {
_, hostFound := backyConfOpts.Hosts[h]
if !hostFound {