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

Method tryGuestBootstrapFallback

internal/ui/plugins/ansible/plugin.go:1695–1722  ·  view source on GitHub ↗
(
	ctx context.Context,
	host coreansible.InventoryHost,
	guestType string,
	nodeByName map[string]coreansible.InventoryHost,
	guestByNodeID map[string]*api.VM,
	nodeSSHUser string,
	script string,
	timeout time.Duration,
	stream func(string),
)

Source from the content-addressed store, hash-verified

1693}
1694
1695func (p *Plugin) tryGuestBootstrapFallback(
1696 ctx context.Context,
1697 host coreansible.InventoryHost,
1698 guestType string,
1699 nodeByName map[string]coreansible.InventoryHost,
1700 guestByNodeID map[string]*api.VM,
1701 nodeSSHUser string,
1702 script string,
1703 timeout time.Duration,
1704 stream func(string),
1705) (output string, transport string, err error) {
1706 switch guestType {
1707 case api.VMTypeLXC:
1708 out, pctErr := executeLXCBootstrapViaPCT(ctx, host, nodeByName, nodeSSHUser, script, stream)
1709 if pctErr != nil {
1710 return out, "pct-exec", pctErr
1711 }
1712 return out, transportPCTExec, nil
1713 case api.VMTypeQemu:
1714 out, gaErr := p.executeQEMUBootstrapViaGuestAgent(ctx, host, guestByNodeID, script, timeout, stream)
1715 if gaErr != nil {
1716 return out, transportGuestAgent, gaErr
1717 }
1718 return out, transportGuestAgent, nil
1719 default:
1720 return "", "", fmt.Errorf("guest type %q has no supported fallback transport", guestType)
1721 }
1722}
1723
1724func finalizeDirectBootstrapResult(
1725 result directBootstrapResult,

Callers 1

Implementers 4

Plugininternal/ui/plugins/ansible/plugin.go
Plugininternal/ui/plugins/communityscripts/p
Plugininternal/ui/plugins/guestlist/plugin.g
Plugininternal/ui/plugins/commandrunner/plug

Tested by

no test coverage detected