I’m often asked by people comming from other configuration management tools (such as Ansible or Salt), how to access data from other nodes in a Puppet manifests.
I wanted to summarize a bit
There are multiple ways to do that in Puppet that allows a node to interact or share information with another node
As these feature are considered an avdanced usage but people discovering the tool and it’s language might not understand all of this at first glance, so let’s dig a bit in its cabalities.
The easiest and common way to store data in Puppet is to use Hiera.
The Exported Resources is a feature that’s well known,
In Ansible you can use
hostvars and in Salt there’s a thing called the
“mine”, which both allows you to access variables or facts from any host in you