summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/has_interface_with.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.
2015-06-24catch and rescue from looking up non-existent facts when looking for 'kind'Mathias Klette
facter (2.x) only provides facts without interface suffix for * ipaddress * netmask 'macaddress' and 'network' facts will always have the related interface name appended. in turns lookupvar throws errors when strict_variables is enabled.
2014-11-10Fix breaking out of .each loopHunter Haugen
And some other small formatting fixes that don't belong in this patch.
2014-11-10Catch :undefined_variable thrown when Future Parser is enabled with 3.7.xTravis Fields
2014-10-24Merge branch '4.3.x'Travis Fields
Conflicts: README.markdown lib/puppet/parser/functions/has_interface_with.rb
2014-10-08ENTERPRISE-281 fixes issue with has_interfaces and case mismatch causing us ↵Travis Fields
not to return some interfaces
2014-09-22Fix strict_variables = trueTomas Doran
2014-06-23Increase resilience if lookup var comes back with nil objectTravis Fields
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.