puppetlabs / puppet-vscode

Puppet Editing. Redefined.
https://puppet-vscode.github.io
Apache License 2.0
81 stars 40 forks source link

Facts view: remote query #722

Open nod0n opened 3 years ago

nod0n commented 3 years ago

Load facts from a remote system

When working on local code, it would be nice to load facts from a remote system and have then in the facts view. The code in the end goes to git and from there with r10k to the Puppet Server. I would just be handy, to load the facts from a remote system, because my local facts are not the same (different types of *nix, windows)

glennsarti commented 3 years ago

A couple of thoughts here.

Using a different set of facts than what's on the local computer is relatively easy. The hard part is retrieving the facts

One thing we've poked around with is querying a Puppet Enterprise server for the last known facts for computer XXX so we don't have to actually contact the remote computer

We could leverage Bolt to get the remote facts, assuming it's configured with the right inventory and authentication

A minor problem with fact loading is that you won't get custom facts loaded into facter as the modules won't be there for facter

Another option may be to load "canned" facts using facterdb files. So we're not contacting the remote system but surface facts from different systems

logicminds commented 3 years ago

Having done something similar in the puppet debugger you really should support all three methods. Local, remote, and facterdb. Remote should be a puppetdb query and facterdb needs to be a filter query.

Allow the user to select from a list of operating systems by providing a query input or setting.