Expose network configuration via ENC
I'd like to see the hosts network information exposed as parameters in the ENC output. Currently we have to duplicate all this information via host parameters (we use things like main_ip => 10.0.0.5, main_gateway => 10.0.0.1, main_subnet_mask => 255.255.255.0). It would be nice to not have to duplicate all this.
Basically, everything on the subnet page would be nice to have access to from puppet classes.
#1 Updated by Benjamin Papillon about 5 years ago
- Description updated (diff)
- Status changed from New to Feedback
It is possible from 1.2 or 1.3 I don't remember exactly. You have to define the parameters like gateway and DNS in the corresponding Subnet.
Then you can access these informations using the instructions on this wiki page : http://projects.theforeman.org/projects/foreman/wiki/TemplateWriting
Tell me if this solution is workign for you or if you are waiting for full resolution of #2240.
#3 Updated by Marek Hulán over 4 years ago
- Category set to External Nodes
- Status changed from Feedback to New
We should publish all networking (not just subnet) info we have in ENC, namespacing it with a configurable string so users can avoid potential clashes with other networking facts.
We should also add some helpers to that existing puppet classes can be fed with data in a better form that <%= @host.interfaces.first.subnet.gateway %>
#6 Updated by Marek Hulán over 4 years ago
I decided not to make key name configurable. We can collide only with custom global parameters and facts which still comes from Foreman. We already add a lot of other information so if this is needed we should either move all (with some backward compatibility) or none. Feel free to add your comments to the PR if you don't agree.