-
Notifications
You must be signed in to change notification settings - Fork 11
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add functionality to set node object, facts, enviornment based on a remote source #14
Comments
This can be done via the following commands
|
require 'puppet'
def node_object(hostname)
begin
Puppet.initialize_settings
Puppet[:trusted_node_data] = true
rescue
# do nothing otherwise calling init twice raises an error
end
Puppet::Node.indirection.find(hostname)
end
node_object('pe-puppet.localdomain') #<Puppet::Node:0x007fb6a321adc0
@classes=[],
@environment=
#<Puppet::Node::Environment:0x007fb6a3036f68
@attr_expirations={:modules=>2016-05-09 11:59:29 -0700},
@config_version=nil,
@manifest=:no_manifest,
@modulepath=[],
@name=:"*root*",
@value_cache={:modules=>[]},
@watching=true>,
@expiration=2016-05-09 12:29:15 -0700,
@facts=
#<Puppet::Node::Facts:0x007fb6a2ba8708
@expiration=2016-05-09 12:29:15 -0700,
@name="pe-puppet.localdomain",
@values=
{"architecture"=>"x86_64",
"kernel"=>"Darwin",
"domain"=>"local",
"virtual"=>"physical",
"is_virtual"=>"false",
"hardwaremodel"=>"x86_64",
"operatingsystem"=>"Darwin",
"os"=>"{\"name\"=>\"Darwin\", \"family\"=>\"Darwin\", \"release\"=>{\"major\"=>\"14\", \"minor\"=>\"5\", \"full\"=>\"14.5.0\"}}",
"kernelrelease"=>"14.5.0",
"facterversion"=>"2.4.6",
"fqdn"=>"MacBook-Pro.local",
"gid"=>"staff",
"hardwareisa"=>"i386",
"hostname"=>"MacBook-Pro", |
logicminds
changed the title
add functionality to set facts based on a remote source
add functionality to set node object, facts, enviornment based on a remote source
May 9, 2016
logicminds
added a commit
that referenced
this issue
May 10, 2016
* adds new error handling classes * now bubbles error upward after parsing error
logicminds
added a commit
that referenced
this issue
May 10, 2016
* adds new error handling classes * now bubbles error upward after parsing error * adds ability to show classification
Closed
duplicate of #12 |
logicminds
added a commit
that referenced
this issue
Aug 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Puppet has a feature (afaik) that can retrieve facts form either a master or puppetdb. This would be awesome to be able to load the facts from a remote system in order to walk through code and hiera lookups.
The text was updated successfully, but these errors were encountered: