1
votes

Is it possible to test, in a puppet manifest, for a dependency on the compiling node (the master or the applying node in case of a masterless setup)?

I've written a profile manifest for base nodes in my network. All nodes should include this profile, including the puppet masters. In this profile, some parts use puppetdb. This gets installed via a puppetmaster profile manifest. I need a way to conditionally skip the parts of the base profile manifest that uses puppetdb, until it is installed.

1

1 Answers

1
votes

Yes We Can :-)

I think your question alludes to the fact that Facter only gathers information about the agent node, rather than the master.

To retrieve state from the master, you can use the generate function like this:

if generate('/usr/local/bin/is-puppetdb-installed') =~ /^yes/ {
    $puppetdb_installed = true
}

You will need to write a generator script that produces appropriate output.