I want the sites defined in nodes.pp to come from a .yml file. I'm thinking if the .pp file is itself processed first from an .erb file then this would be easy. But as far as I can tell the .pp files cannot be templates themselves, eg. nodes.pp.erb.
I want to keep the nodes definition in yml rather than in .pp because I want to use the same definition for things like vagrant test of deployment. I find it easier to consume a common .yml rather than parse nodes.pp to extract the info.
the obvious solution is to generate nodes.pp on-demand from a nodes.pp.erb, eg. in a rake task, but I wonder if Puppet itself has a solution to my conundrum.
I think puppet hiera would work well for you, check out:
https://github.com/puppetlabs/hiera#readme
Related
I want to do some configurations for Google Cloud Ops-Agent in order to deploy it via Ansible.
For example /etc/google-cloud-ops-agent/kafka.yaml
How to include *.yaml configs?
If using /etc/google-cloud-ops-agent/config.yaml I'm worried then the configuration will be overwritten
There are two ways I can think of to do this.
The easiest (and least precise): use the copy module to recusively copy the the directory content to the target. Of course, if there are files other than ".yaml", you'll get those as well.
The more complex way...and I have not tested this. use the find module to execute locally on the control node, to get a list of the .yaml files, register their locations and then copy them up. There's probably a simpler way.
Is there a way to configure the names of the files exported from Logging?
Currently the file exported includes colons. This are invalid characters as a path element in hadoop, so PySpark for instance cannot read these files. Obviously the easy solution is to rename the files, but this interferes with syncing.
Is there a way to configure the names or change them to no include colons? Any other solutions are appreciated. Thanks!
https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/introduction.md
At this time, there is no way to change the naming convention when exporting log files as this process is automated on the backend.
If you would like to request to have this feature available in GCP, I would suggest creating a PIT. This page allows you to report bugs and request new features to be implemented within GCP.
When creating or editing a Role in the GUI I can't find a way to add a cookbook.
I have my recipes grouped in different cookbooks, but it seems when I create a role I have to add every recipe one by one. It does not make sense to me.
For instance, I have a cookbook that adds about 30 configuration files, each one with its own recipe. I would like to add that cookbook to a role, I don't know how.
It seems when I create a role I can add sub-roles and recipes, but not cookbooks. To me is like somebody asks me for my recipes for soups, and instead of giving him my book with soup recipes I start searching around for all my recipes about soup.
Any idea ?
Thanks,
Luis
That's the way chef works. You set a run list of recipes.
If you wish to do all in one pass create a recipe named all_recipesfor exemple and containing
include_recipe "you_cookbook::recipe_name1"
include_recipe "you_cookbook::recipe_name2"
include_recipe "you_cookbook::recipe_name3"
But if you intent is to manage 30 files in the same way, you may loop over them in a single recipe instead of doing one recipe per file.
Having multiple recipes in a cookbook is more to manage different cases (service or cronjob, unix system or windows system, etc).
All in all it sounds like a bad design at first. (No judgement, just a feeling with the few information you gave)
For your soup exemple, you're taking it the wrong way.
It's not that someone ask you for recipes, it's you telling a chef to cook things.
If you want him to cook everything in a cokbook, you have to tell him that's what you want, but a recipe for a particular soup may reference other 'common' recipes (like peel potatoes) etc.
I have a scenario where I need to replace certain Strings in an attribute file within a cookbook with user input from within a Bash script.
In the current puppet setup this is done simply by using sed on the module files, since the modules are stored in the file structure as files and folders.
How can I replicate this in the Chef eco-system? Is there a known shortcut?
Or would I have to download the cookbook as a file using knife, modify the content and then re-upload again to make the changes?
Not sure this is the best approach. You can definitely use knife download, sed, and knife upload as you mentioned but a better way would be to make it data driven. Either store the values in a data bag or role, and manipulate those either using knife or another API client. Then in your recipe code you can read out the values and use them.
I am building a ruby gem that should output a logfile. Where is it a good practice to store log files?
I am extracting this functionality from a Rails website I am building, and there I could simply log in the log/ directory.
Ideally, make the path configurable (.rc file, switch, rails/rack config, whatever).
If it's a Rack middleware, add the possibility to specify it in the constructor's arguments.
If no log path is provided, fallback to detecting a log directory. (I vaguely remember it being config.paths['log'] in Rails, but be sure that config actually points to something before using that in your gem if it can be used outside of Rails.)
And if all else fails, log to nowhere...
Also, allow to disable logging if you enable it by default. Not everyone wants logs.