ripienaar/puppet-classifier

Setting hiera values based on classifier

ggeldenhuis opened this issue · 6 comments

One of my use cases currently is to check if certain hardware is present and if so include an appropriate class. Specifically checking for FPGA cards.

When the FPGA cards are added I also need to re-enable a service that is disabled by default based on a list that is set in data directory for the profiles module.

So normally I would just do:

profiles::disabled_services::list:
  - "--rpcbind"
  - "--nfs-server"
  - "--nfs"

to re-enable certain services based on my hiera hierarchy. However I am reluctant to modify my hierarchy for such a small subset of servers and it would be great if I could use the classifier to set hiera variables. Not sure it is possibly but hopefully the idea is clear.

Not sure I follow but I imagine you want something like this back? 3444913

You could do that using a custom hiera backend (https://puppet.com/docs/puppet/6.7/hiera_custom_backends.html) thats built as a puppet function accessing the data hash?

A bit like that... oh the irony for having removed it.

Well we removed it because the hiera functions let one do that and better :)

Hi. I don't know if it can be useful for anybody and/or if this project is still maintained, but I was able to create a simple custom hiera backend that can use the classifier::data hash. If anyone is interrested I can contribute a PR.

Certainly I am not looking after it anymore - happy to hand to someone else or add colabs who wish to move it forward

I don't think this module needs to really evolve a lot, it is already working quite fine. I've done a quick PR.