MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / finalizeDirectBootstrapResult

Function finalizeDirectBootstrapResult

internal/ui/plugins/ansible/plugin.go:1724–1759  ·  view source on GitHub ↗
(
	result directBootstrapResult,
	output string,
	dryRun bool,
	transport string,
)

Source from the content-addressed store, hash-verified

1722}
1723
1724func finalizeDirectBootstrapResult(
1725 result directBootstrapResult,
1726 output string,
1727 dryRun bool,
1728 transport string,
1729) directBootstrapResult {
1730 result.Output = output
1731 if transport != "" {
1732 result.Transport = transport
1733 }
1734 if strings.Contains(output, "changed=1") {
1735 result.Status = statusChanged
1736 result.Changed = true
1737 if result.Transport != "" {
1738 result.Message = fmt.Sprintf("changes applied via %s", result.Transport)
1739 } else {
1740 result.Message = "changes applied"
1741 }
1742 return result
1743 }
1744 if dryRun {
1745 if result.Transport != "" {
1746 result.Message = fmt.Sprintf("dry-run completed via %s", result.Transport)
1747 } else {
1748 result.Message = "dry-run completed"
1749 }
1750 } else {
1751 if result.Transport != "" {
1752 result.Message = fmt.Sprintf("already in desired state via %s", result.Transport)
1753 } else {
1754 result.Message = "already in desired state"
1755 }
1756 }
1757
1758 return result
1759}
1760
1761func buildDirectBootstrapScript(cfg cfgpkg.AnsibleBootstrapConfig, keyContent string, dryRun bool) string {
1762 userQuoted := shellSingleQuote(strings.TrimSpace(cfg.Username))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected