summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/has_ip_network.rb
AgeCommit message (Collapse)Author
2017-03-01(MODULES-4473) join strings for i18n parserEric Putnam
This commit joins all strings that are split over two lines with a plus, backslash, or double less than so that our magical i18n parser can wave over the module and mark every ruby string with our i18n function.
2012-11-07(#13974) Add predicate functions for interface factsWil Cooley
If one wishes to test if a host has a particular IP address (such as a floating virtual address) or has an interface on a particular network (such as a secondary management network), the facts that provide this information are difficult to use within Puppet. This patch addresses these needs by implementing functions ‘has_ip_address(value)’ and ‘has_ip_network(value)’. These functions look through all interfaces for ipaddress_<interface> and network_<interface> (respectively) having the requested <value>. These functions are implemented on top of a lower-level predicate function, ‘has_interface_with(kind, value)’, which iterates through the interfaces in the ‘interfaces’ fact and checks the facts <kind>_<interface> looking for <value>. Additionally, the existence of a particular named interface can be checked for by calling with only a single argument: has_interface_with(interface). A Boolean is returned in all cases.