1

Is it possible to access facts of one system from another system via any built-in puppet command? I tried to do that with puppet facts find "node_certificate" but its not working (instead I get facts of the same system on which I'm running the command).

Kusalananda
  • 333,661
Rajnish Kumar Soni
  • 1,047
  • 2
  • 13
  • 20

1 Answers1

1

You can use tags and exported resources.

This will create an exported resource and tag it. For example the template used for the file can contain facts variables. This is nagios example - you probably want this on every host.

@@file { "${::fqdn}.conf":
  ensure  => file,
  mode    => '0640',
  mode    => root,
  group   => root,
  path    => "/etc/nagios/hosts/${::fqdn}.conf",
  content => template('nagios/host.conf.erb'),
  tag     => "nagios-hosts",
}

and this will collect them. You want this only on nagios server.

  File <<| tag == 'nagios-hosts' |>>
Jakub Jindra
  • 1,462