Age | Commit message (Collapse) | Author |
|
This reverts commit f7a18189ec338b01b0fc89d75def832753af3868, reversing
changes made to 36a7b29630a4d4de17af79b5dd4e9491ec20b123.
I'm reverting this change because of concerns raised by Peter Meier that
it duplicates the "in" operator in the DSL. The "in" operator is new
information that I did not posses when I made the decision to merge.
Because of this new information I'm un-merging and continuing the
discussion in the comments of
https://projects.puppetlabs.com/issues/19272
Reference: GH-130
|
|
It is exceptionally difficult to determine if an array contains an element matching a specific value without an iteration or loop construct.
This function is the Puppet equivalent of Array.includes?(foo) in Ruby. The implementation is a verbatim copy of has_key() with the minor modifications needed to support arrays instead of hashes.
|
|
|
|
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.
|
|
Without this patch the basic smoke test in the module tests/ directory
did not math up with the renamed whole_line => file_line resource type.
This patch updates the smoke test file to match the most recently
selected name of file_line. The filename has been changed, comments
added to the smoke test file, and resource declarations inside the file
changed.
|
|
Changed the type name from append_line to
whole_line.
After feedback that having a type with a verb in
the name was confusing.
|
|
This commit adds a native type that can check if
a line exists and append it to a file.
This use case seems common enough to warrant its
inclusion into stdlib.
Reviewed-by: Jeff McCune
|
|
|