go-ansible/cmd/ansible/cmd.go
Virgil 8ebfafd6cc
Some checks are pending
CI / test (push) Waiting to run
CI / auto-fix (push) Waiting to run
CI / auto-merge (push) Waiting to run
refactor(ansible): rename cli helpers for clarity
2026-04-03 11:11:17 +00:00

46 lines
1.3 KiB
Go

package ansiblecmd
import (
"dappco.re/go/core"
)
// Register registers the `ansible` command and its `ansible/test` subcommand.
//
// Example:
//
// var app core.Core
// Register(&app)
func Register(c *core.Core) {
c.Command("ansible", core.Command{
Description: "Run Ansible playbooks natively (no Python required)",
Action: runPlaybookCommand,
Flags: core.NewOptions(
core.Option{Key: "inventory", Value: ""},
core.Option{Key: "i", Value: ""},
core.Option{Key: "limit", Value: ""},
core.Option{Key: "l", Value: ""},
core.Option{Key: "tags", Value: ""},
core.Option{Key: "t", Value: ""},
core.Option{Key: "skip-tags", Value: ""},
core.Option{Key: "extra-vars", Value: ""},
core.Option{Key: "e", Value: ""},
core.Option{Key: "verbose", Value: 0},
core.Option{Key: "v", Value: false},
core.Option{Key: "check", Value: false},
core.Option{Key: "diff", Value: false},
),
})
c.Command("ansible/test", core.Command{
Description: "Test SSH connectivity to a host",
Action: runSSHTestCommand,
Flags: core.NewOptions(
core.Option{Key: "user", Value: "root"},
core.Option{Key: "u", Value: "root"},
core.Option{Key: "password", Value: ""},
core.Option{Key: "key", Value: ""},
core.Option{Key: "i", Value: ""},
core.Option{Key: "port", Value: 22},
),
})
}