Skip to content

Commit 9636456

Browse files
authored
Merge pull request #63 from ffrank/planning-39-impl-facts
Add 'implementation' fact to agent and server.
2 parents bde78fc + ae363fc commit 9636456

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

lib/puppet/node/facts.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def save(instance, key = nil, options = {})
2828
attr_accessor :name, :values, :timestamp
2929

3030
def add_local_facts
31+
values["implementation"] = "openvox"
3132
values["clientcert"] = Puppet.settings[:certname]
3233
values["clientversion"] = Puppet.version.to_s
3334
values["clientnoop"] = Puppet.settings[:noop]

lib/puppet/node/server_facts.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ class Puppet::Node::ServerFacts
44
def self.load
55
server_facts = {}
66

7+
# Add implementation information
8+
server_facts["implementation"] = "openvox"
9+
710
# Add our server Puppet Enterprise version, if available.
811
pe_version_file = '/opt/puppetlabs/server/pe_version'
912
if File.readable?(pe_version_file) and !File.zero?(pe_version_file)

spec/unit/node/facts_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
@facts.add_local_facts
3636
expect(@facts.values["environment"]).to eq("foo")
3737
end
38+
39+
it "adds the implementation fact" do
40+
@facts.add_local_facts
41+
expect(@facts.values).to include("implementation")
42+
expect(@facts.values["implementation"]).to eq("openvox")
43+
end
3844
end
3945

4046
describe "when sanitizing facts" do

0 commit comments

Comments
 (0)