example hiera.yaml that uses example42-network?

404 views
Skip to first unread message

Anthony Clark

unread,
Oct 24, 2014, 2:49:34 PM10/24/14
to puppet...@googlegroups.com
Hi All,

Does anyone use example42-network with Hiera?  I'm trying to find an example in Hiera that configures that module.


So far I've tried, in <hostname>.yaml (Hiera works OK with hostname, environment, etc etc)

---
network::interfaces_hash:
  eth1:
    ipaddress: 1.2.3.4
    netmask: 255.255.0.0
    gateway: 1.2.3.1

Which I think should work, based on the Puppet example from the Forge module readme:

class { 'network': interfaces_hash => 
  { 'eth0' => { enable_dhcp => true, },
    'eth1' => { ipaddress => '10.42.42.50', netmask => '255.255.255.0', },
  },
}

So, any pointers on where I'm going wrong?

Thanks in advance,

Anthony

Wil Cooley

unread,
Oct 24, 2014, 4:54:53 PM10/24/14
to puppet-users group
On Fri, Oct 24, 2014 at 7:49 AM, Anthony Clark <dizzy...@gmail.com> wrote:
Hi All,

Does anyone use example42-network with Hiera?  I'm trying to find an example in Hiera that configures that module.


So far I've tried, in <hostname>.yaml (Hiera works OK with hostname, environment, etc etc)

---
network::interfaces_hash:
  eth1:
    ipaddress: 1.2.3.4
    netmask: 255.255.0.0
    gateway: 1.2.3.1

Which I think should work, based on the Puppet example from the Forge module readme:

class { 'network': interfaces_hash => 
  { 'eth0' => { enable_dhcp => true, },
    'eth1' => { ipaddress => '10.42.42.50', netmask => '255.255.255.0', },
  },
}

What's actually happening when you do this?

I assume you also have "include network" in your manifests?

Wil

Anthony Clark

unread,
Oct 28, 2014, 6:17:24 PM10/28/14
to puppet...@googlegroups.com
It was indeed an issue with the network class not being included in the particular environment I was using.

I've remedied that now.

Just as an aside, the syntax below was correct.

Alessandro Franceschi

unread,
Nov 4, 2014, 8:26:48 PM11/4/14
to puppet...@googlegroups.com
FYI, here you can see some sample hiera data:
https://gist.github.com/alvagante/b8f67647c78590f3e67a
Reply all
Reply to author
Forward
0 new messages