(node *api.Node, guest *api.VM, inventory coreansible.InventoryResult)
| 2535 | } |
| 2536 | |
| 2537 | func (p *Plugin) defaultLimitForSelection(node *api.Node, guest *api.VM, inventory coreansible.InventoryResult) string { |
| 2538 | switch strings.ToLower(strings.TrimSpace(p.ansiblePluginConfig().DefaultLimitMode)) { |
| 2539 | case "none": |
| 2540 | return "" |
| 2541 | case "all": |
| 2542 | return "all" |
| 2543 | } |
| 2544 | |
| 2545 | if guest != nil { |
| 2546 | for _, host := range inventory.Hosts { |
| 2547 | if host.Vars["pvetui_kind"] != "guest" { |
| 2548 | continue |
| 2549 | } |
| 2550 | if host.Vars["pvetui_guest_id"] == fmt.Sprintf("%d", guest.ID) && host.Vars["pvetui_node"] == guest.Node { |
| 2551 | return host.Alias |
| 2552 | } |
| 2553 | } |
| 2554 | } |
| 2555 | |
| 2556 | if node != nil { |
| 2557 | for _, host := range inventory.Hosts { |
| 2558 | if host.Vars["pvetui_kind"] == "node" && host.Vars["pvetui_node"] == node.Name { |
| 2559 | return host.Alias |
| 2560 | } |
| 2561 | } |
| 2562 | } |
| 2563 | |
| 2564 | return "" |
| 2565 | } |
| 2566 | |
| 2567 | func (p *Plugin) mergeConfiguredAnsibleArgs(userArgs []string) []string { |
| 2568 | cfg := p.ansiblePluginConfig() |
no test coverage detected