-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using something like an 'include' directive? or better with templates #138
Comments
I have thought about this some in the past, so I'm curious to hear your thoughts on my thoughts! So since NHC is Bash, there are ways that we can take advantage of some (potentially obscure?) Bash features to accomplish this task already. For example, there is a command-line option, nhc -c <(cat /etc/nhc/{pre_cfg,post_cfg,prod}_checks) ... Bash replaces that expression with a special file path referencing a particular file descriptor, so There are other similar "tricks" we can use...but you get the idea. 😄 Here at LANL, though, we currently use Ansible for doing config management, and our NHC role supplies the desired checks for each context as a named YAML list and a Jinja2 template that iterates over them. If you already have a templating engine as part of your existing CM infrastructure, using that is probably the sanest option. Having said all that, if there's sufficient interest, adding an "include" feature to NHC itself should be relatively simple -- have Any thoughts? |
I also thought about the use of process substitution, but was avoiding that with systemd and wasn't planning on prefixing the execution with I've also started just implementing it with Ansible and the jinja2 templating which allowed me to be a little more efficient / lazy about writing the config honestly. I think that's probably better off that way for the most part at our site for now. Would be curious how many other sites are using templating engine though or vice versa where having the I'll have to glance at the |
I have a odd need to run probably 3 (2 at least) different configs for NHC on a node (at different points in their boot / triage cycles). Many of the checks are the same between them all and maybe this is better for a templating engine, but I'd prefer to keep the configs in one place from the templating engine we already have and then do an include. An example might be:
production NHC
With a precursor run to cfg checks just be
Again, this may be more elegant in a templating engine like ERB or Jinja2. Just posing a thought I guess. I could also be missing something totally obvious as well.
The text was updated successfully, but these errors were encountered: