FAQ
One other option would be to use `has_ip_network` from puppetlabs/stdlib.
On Fri, Mar 20, 2015 at 1:59 PM Wil Cooley wrote:
On Fri, Mar 20, 2015 at 8:45 AM Gary Jackson wrote:

Sadly, they are not. What I probably want is one of two things for my
case statement:

1. The bitwise AND of the ipaddress and netmask facts.
2. Pull apart the interfaces fact and use the network_*iface* fact for
the first interface in that list.

Can I do either of these things without resorting to a custom fact?
The latter is easy enough to do:

/tmp/test.pp:
$interface_array = split($::interfaces, ',')
notice("interfaces is ${::interfaces}")
notice("first interface is ${interface_array[0]}")

$ puppet apply /tmp/test.pp
Notice: Scope(Class[main]): interfaces is em1,lo
Notice: Scope(Class[main]): first interface is em1
Notice: Compiled catalog for mydesktop in environment production in 0.01
seconds
Notice: Finished catalog run in 0.08 seconds

You could do the bit-fiddling with a custom function easily enough or if
you want to be quick and dirty you use `inline_template` and to it in Ruby.

Wil
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAMmm3r6VNS%3DH5DapmUeoLFRS%3DrpzgLmfWcDJ8G3Z1hocL%3DrA9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 5 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMar 20, '15 at 3:30p
activeMar 20, '15 at 9:02p
posts5
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2021 Grokbase