From 8a754e0858d922e955e71b253c139e071ecec432 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 18:04:21 +0200 Subject: Adding upstream version 2.14.3. Signed-off-by: Daniel Baumann --- lib/ansible/plugins/filter/combinations.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/ansible/plugins/filter/combinations.yml (limited to 'lib/ansible/plugins/filter/combinations.yml') diff --git a/lib/ansible/plugins/filter/combinations.yml b/lib/ansible/plugins/filter/combinations.yml new file mode 100644 index 0000000..a46e51e --- /dev/null +++ b/lib/ansible/plugins/filter/combinations.yml @@ -0,0 +1,26 @@ +DOCUMENTATION: + name: combinations + version_added: "historical" + short_description: combinations from the elements of a list + description: + - Create a list of combinations of sets from the elements of a list. + positional: _input, set_size + options: + _input: + description: Elements to combine. + type: list + required: true + set_size: + description: The size of the set for each combination. + type: int + required: true +EXAMPLES: | + + # combos_of_two => [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 2, 3 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ], [ 4, 5 ] ] + combos_of_two: "{{ [1,2,3,4,5] | combinations(2) }}" + + +RETURN: + _value: + description: List of combination sets resulting from the supplied elements and set size. + type: list -- cgit v1.2.3