Questions tagged [facter]

Facter is an independent, cross-platform Ruby library bundled with Puppet, designed to gather basic node information about the hardware and operating system

Developed by Puppet Labs to help with automated system configuration management. A puppet manifest declares the required state of the machine. Facter retrieves the current state, so that Puppet can work out what changes need to be made, and how.

The Facter gem can be used by any Ruby system, without the rest of Puppet.

117 questions
48
votes
6 answers

Puppet/Facter "Could not retrieve fact fqdn": How to fix or circumvent?

I'm learning about puppet and trying to experiment with it on a VM at home. I'm not using a puppet server yet, just running things locally. It works okay, but every time I run puppet apply ..., I get a delay of several seconds, after which it…
Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
7
votes
7 answers

Facts.d - Pluginfacts could not be retrieved during puppet run

I've just upgraded my puppet environment from 3.4.2 to 3.4.3. through puppetlabs' apt repos. I was upgrading agent(s) and master. Doing an agent run leads to following error: Info: Retrieving pluginfacts Debug: Failed to load library 'msgpack' for…
ITL
  • 422
  • 1
  • 5
  • 17
5
votes
1 answer

undefined method get_uptime for Facter::Util::Uptime:Module (NoMethodError)

I'm trying to setup a puppet node, but rubygems doesn't seem to behave. If I run facter on the cli via it's own binary (/usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter), it works fine, but if I run it through the binary installed by rubygems…
Andrei Serdeliuc ॐ
  • 5,828
  • 5
  • 39
  • 66
4
votes
0 answers

append multiple structured custom facts

I'm trying to get multiple structured custom facts to append to my root key (called rag here), but instead they always replace the current value. Q1: Is this the expected behavior of Facter.add ? So to get it to work i created two external facts,…
RASG
  • 5,988
  • 4
  • 26
  • 47
4
votes
4 answers

Python version of "facter"?

I'm considering collect server data and in those servers Python 2.6 are pre-installed. Now I wonder if there are Python library correspond to "facter" of Ruby, not the Python "binding" for facter. I googled about it but couldn't find any. Does…
Yoshi
  • 405
  • 4
  • 12
3
votes
2 answers

How to resize the root filesystem during AMI creation with packer?

I faced the the problem that some apache logs filled so quick that the root filesystem was not big enough. I am using an AMI created with packer and centos 6. How can I resize the root FS during the AMI creation to have it ready for later usage?
Zioalex
  • 3,441
  • 2
  • 33
  • 30
3
votes
1 answer

Use other facts in a custom fact

I am having a tough time with the following custom fact; details below. The custom fact needs to look for a certain json file in the following folder. This displays the information when used within a manifest. But, when I add it to the custom fact,…
souser
  • 5,868
  • 5
  • 35
  • 50
3
votes
1 answer

Filter keys from a map in Puppet

I need the mount points in puppet that refer to /datadisks. I use mountpoints core facts to obtain the mount points. Within these mount points, I want to filter and get only the mount points whose names contain /datadisks in an array i.e I just want…
Sandeep Kanabar
  • 1,264
  • 17
  • 33
3
votes
2 answers

How can I mock facts to test a Puppet template that does decimal multiplication on a fact?

Context: I have a puppet template that addresses the count sub-component of the processors fact when it is rendered. That fact exists on all of my clients. The use case for the fact is in a template line that performs decimal math on it, e.g.:…
Zac B
  • 3,796
  • 3
  • 35
  • 52
3
votes
2 answers

Custom fact should run after a package is installed

I have a small custom fact in a my php module Facter.add('php_extension_version') do setcode do Facter::Core::Execution.exec("php -i | awk '/^PHP Extension =>/ { print $4}'") || nil end end This obviously requires the php binary to be…
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278
3
votes
2 answers

Custom fact with home directorys as domains for puppet

I'm trying to generate a custom fact called domains. the idea is to list all the directories within /home but remove some default directory's such as centos, ec2-user, myadmin. I'm using bash as I don't know ruby. so far my script outputs the list…
Kevin
  • 123
  • 2
  • 10
3
votes
1 answer

puppet custom fact for facter

Trying to write a custom facter module: Facter.add("something_status") do setcode do $string_to_parse = Facter::Util::Resolution.exec('somecommand --print ') ... do something to string return something-new end end Very new to…
Cmag
  • 14,946
  • 25
  • 89
  • 140
2
votes
1 answer

Configure remote rulesets with Puppet

I'm trying to automate the Prometheus node_exporter and my Prometheus Server. For the node_exporter I've written a module to install all the needed packages, set the $::ipaddress based on facter and some more.. Now I'd like to make sure that the…
2
votes
2 answers

greping or filtering linux output in ruby for custom fact

I'm a beginner in ruby and I have been blowing out my head with this: I need to "split the ethtool output into different variables, this is what I have done: [root@aptpka02 facter]# cat test.rb interface =…
josseossa
  • 51
  • 8
2
votes
2 answers

Fact file was parsed but returned an empty data set

For my current module, I need to check if php version 5 or 7 is installed and created a fact for this. The fact file is stored in the modules directory in facts.d/packageversion.rb and has the following content: #!/usr/bin/ruby require…
Studentus
  • 49
  • 1
  • 10
1
2 3 4 5 6 7 8