Hello all!
I trying to figure out how to put my host network information under hiera (using puppet4 opensource with no enc)
Maybe I got this all wrong but this what I was thinking:
Base.pp
Profiles::base
Include profiles::network
Network.pp # contains my logic to check if it's static or bonding network interface. Calls razoredge network module to actually do the work.
Class profiles::network {
If hiera(profiles::network::network_info::type) == bonding { #based on fqdn hiera lookup
Network::bond::static { ‘bond0’:
Ensure =>‘up’,
Ipaddress =>“profiles::network::network_info::ipadress”
Else
Network::if::static
Ensure =>‘up’
Ipadress =>“profiles::network::network_info::ipadress”
}
Host1.toto.com.yaml #host network information based on fqdn hiera declaration
Profiles::network::network_info
Type: bonding
Ipadress: 10.10.10.10
Gateway: 10.10.10.1
Routes:
- 10.10.10.2
- 10.10.10.3
I know my code is all wrong but anybody using hiera for host-network-information? Or if it's really bad practice to do so.
Thanks!
Eric
↧