Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use multiple different puppet masters from one puppet agent?

Tags:

puppet

There is the need that one puppet agent contacts some different puppet masters.

Reason: there are different groups that create different and independent sets of manifests.

Possible groups and their tasks

  • Application Vendor: configuration of application
  • Security: hardening
  • Operations: routing tables, monitoring tools

Each of these groups should run it's own puppet master - the data (manifests and appropriate data) should be strictly separated. If it is possible, one group should even not see / have access to the manifests of the others (we are using MAC on the puppet agent OSes).

Thoughts and ideas that all failed:

  • using (only) hira is not flexible as needed - there is the need to have different manifests.
  • r10k: supports more than one environment, but in each environment can only access one set of manifests.
  • multi but same puppet server using e.g. DNS round robin: this is the other way round. We need different puppet masters.

Some ways that might be possible but...

  • running multiple instances of puppet agents. That 'feels' strange. Advantage: the access rights can be limited in the way as needed (e.g. the application puppet agent can run under the application user).
  • patching puppet that it can handle more than one puppet master. Disadvantage: might be some work.
  • using other mechanisms to split responsibility. Example: use different git-repositories. Create one puppet master. The puppet master pulls all the different repositories and serves the manifests.

My questions:

  1. Is there a straight forward way implementing this requirement with puppet?
  2. If not, is there some best practice how to do this?
like image 803
Andreas Florath Avatar asked Oct 29 '25 02:10

Andreas Florath


1 Answers

While I think what you are trying to do here is better tackled by incorporating all of your modules and data onto a single master, and that utilizing environments will be effectively the exact same situation (different masters will provide a different set of modules/data) this can be achieved by implementing a standard multi-master infrastructure (one CA master for cert signing, multiple compile masters with certs signed by the same CA master, configured to forward cert traffic elsewhere) and configure each master to have whatever you need. You then end up having to specify which master you want to check in to on each run (a cronjob or some other approach), and have the potential for one checkin to change settings set by another (kinda eliminating the hardening/security concept). I would urge you to think deeper on how to collaborate your varied aspects (git repos for each division's hiera data and modules that have access control) so that a central master can serve your needs (and access to that master would be the only way to get data/modules from everywhere). This type of setup will be complex to implement, but the end result will be more reliable and maintainable. Puppet inc. may even be able to do consultation to help you get it right.

There are likely other approaches too, just fyi.

like image 132
Josh Souza Avatar answered Oct 31 '25 23:10

Josh Souza