Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Puppet in computing is a tool that helps us automate and manage the configuration of servers. Using Puppet isn't just about the tool but also about a way of working and culture. Puppet is made up of multiple packages. All these packages are known as the Puppet platform, which stores, manages, and runs puppet codes.
Puppet works on many documentation and resources to help us learn Puppet. So, In this article, we will learn about Facter in Puppet in detail. Stay till the end!
Facter
Facter is a cross-platform system profiling library in Puppet. It detects and informs per-node facts provided in our Puppet manifest as variables. If we have Ruby installed already in our system, we can install Factor by running the following command:
gem install facter
Facter: CLI
The library behind Facter is convenient and easy to expand. This makes Facter the most straightforward way to collect info about a system. If we are given no queries, it will return all facts to us.
Most command line options can be set through the HOCON configuration file. This file can also be used to cache or block specific fact groups.
Options
--color:
For enabling output.
--config, -c:
For the location of the configuration file.
--no-color:
For disabling color output.
--no-ruby:
For disabling loading Ruby, custom facts, & facts requiring Ruby.
--strict:
This option enables more aggressive error reporting.
--puppet, -p:
This option loads the Puppet libraries, hence allows Facter to load Puppet-specific facts.
Here is the list of all the built-in facts that ship with Facter, including newer structured facts and legacy facts.
Modern Facts
Fact name
Type
Purpose
augeas
map
Return Info about augeas.
az_metdata
map
Returns the Microsoft Azure instance metadata.
cloud
map
Returns info about the cloud instance of the node.
dmi
map
Returns the information about system management.
ec2_metadata
map
Returns the EC2 instance metadata.
ec2_userdata
map
Returns the EC2 instance user data.
filesystems
string
Returns the usable file systems for disk devices or block.
fips_enabled
boolean
Returns if the platform is in FIPS mode.
processors
map
Returns info about the processors of the system.
path
string
Returns the PATH environment variable.
solaris_zones
map
Returns info about solaris zones.
timezone
string
Returns the system timezone.
xen
map
Returns metadata for the xen hypervisor.
nim_type
string
It determines if the node is standalone or master inside an AIX Nim environment.
zpool_version
string
Returns the version for ZFS storage pools.
virtual
string
Returns the name of the hypervisor for virtual machines for physical machines.
Legacy Facts
Fact name
Type
Purpose
architecture
string
Returns the hardware architecture of the operating system.
augeasversion
string
Return the version of augeas.
bios_vendor
string
Returns the vendor of the BIOS system.
boardproductname
string
Returns the board product name of the system.
boardserialnumber
string
Returns the board serial number of the system.
domain
string
Returns the network domain of the system.
fqdn
string
Returns the FQDN of the system.
hardwaremodel
string
Returns the hardware model of operating system.
id
string
Returns the UID of the user running facter.
interfaces
string
Returns the comma-seperated list of network interfaces names.
ldom_<name>
string
Returns information regarding solaris LDom.
macaddress
mac
Returns the MAC address for the default network interface.
memoryfree
string
Returns the display size of the free system memory.
memorysize
string
Returns the display size of the total system memory.
network
ip
Returns the IPv4 network for the default network interface.
operatingsystem
string
Returns the name of the os.
osfamily
string
Returns the family of the os.
sapsize_mb
double
Returns the size of the total swap memory.
system32
string
Returns the path to the system32 directory on Windows.
uptime
string
Returns the uptime of the system.
uptime_days
integer
Return the uptime days of the system.
uuid
string
Returns the product unique identifier of the system.
zone_<name>_status
string
Returns the zone state for the solaris zone.
zonename
string
Returns the name of the present solaris zone.
zones
integer
Returns the count of Solaris zones.
Frequently Asked Questions
What is a Puppet?
It is a tool that helps manage and automate the configuration of servers.
What is Puppet code?
Puppet code is an easy way to programmatically describe what configurations should be in place on the operating systems & applications that you want to manage.
How do you create a custom fact in Puppet?
Custom facts can be added to the main Puppet server by writing snippets of Ruby code. Puppet then distributes the facts to the client via plug-ins in modules.
How do you identify Puppet facts?
Run facter -p on the command line to see a node's fact values or browse facts on node detail pages in the Puppet Enterprise console.
What is puppet software used for?
Puppet is a software configuration management and deployment tool that is open source. It is most commonly used on Linux and Windows to pull the strings on multiple application servers simultaneously.
Conclusion
In this article, we explored the topic of Facter in Puppet. We started with introducing Puppet, and then we further discussed Facter and Facter: CLI.
We hope this blog has helped you enhance your knowledge of Facter in Puppetand if you want to learn more, check out our articles here.