puppet provider

asked 2014-08-26 22:18:12 -0500

christian.cadieux gravatar image

here is a scenario with a datalink and an interface. The interface need the datalink: datalink_device { 'device1' : ensure => present, class => 'device', label => 'Untitled Datalink', mac => 'a0:36:9f:4:8c:13', links => [ "igb1"], jumbo => false, mtu => '1500', speed => 'auto', duplex => 'auto' }

interface_ip { 'interface1' :
ensure => present, state => 'failed', curaddrs => [], class => 'ip', label => 'Untitled Interface', enable => true, admin => true, links => [ "$datalink"], v4addrs => [], v4dhcp => true, v6addrs => [], v6dhcp => false }

The problem is that when creating a datalinkdevice, the system select a datalink (igb1) which is a read-only property of the datalinkdevice and that value ($datalink) need to be used when creating the interfaceip. Programmatically, this would look like this: d = datalinkdevice.new(...) interfaceip(d.getdatalink) : the datalink generated by datalinkdevice is passed as an argument to interfaceip

How is this problem done with Puppet. Does Hiera support this. thanks

edit retag flag offensive close merge delete