Sharing credentials from puppet master to agents

79 Views Asked by At

I am facing an issue in for pass db credentials to agents for custom facts .

Unable to fetch the credentials from hiera with puppet lookup in agent

1

There are 1 best solutions below

0
On

Unable to fetch the credentials from hiera with puppet lookup in agent

That's to be expected. puppet lookup performs a local lookup, not a lookup on the server. As such, it generally is not useful on agent nodes.

It's unclear how exactly you have in mind to use these DB credentials, but "for custom facts" suggests that you want agents to perform queries on local databases as part of the computation of the values of some of your custom facts. There are at least these alternatives that might work better:

  • Have the server perform the queries and expose the results as class variables, instead of making agents provide the same data as facts.

  • Embed the required credentials in the custom fact implementation(s).

If in fact the queries are to be performed against a central database instead of local one, then you could also consider a variation on that first option, in which you set up a custom Hiera back end that uses the database as its data source.