diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /lib/ansible/plugins/filter/permutations.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream.tar.xz ansible-core-upstream.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/plugins/filter/permutations.yml')
-rw-r--r-- | lib/ansible/plugins/filter/permutations.yml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/permutations.yml b/lib/ansible/plugins/filter/permutations.yml new file mode 100644 index 0000000..6e0202b --- /dev/null +++ b/lib/ansible/plugins/filter/permutations.yml @@ -0,0 +1,26 @@ +DOCUMENTATION: + name: permutations + version_added: "historical" + short_description: permutations from the elements of a list + description: + - Create a list of the permutations of lists from the elements of a list. + - Unlike combinations, in permutations order is significant. + positional: _input, list_size + options: + _input: + description: Elements to base the permutations on. + type: list + required: true + list_size: + description: The size of the list for each permutation. + type: int + required: true + +EXAMPLES: | + # ptrs_of_two => [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 2, 1 ], [ 2, 3 ], [ 2, 4 ], [ 2, 5 ], [ 3, 1 ], [ 3, 2 ], [ 3, 4 ], [ 3, 5 ], [ 4, 1 ], [ 4, 2 ], [ 4, 3 ], [ 4, 5 ], [ 5, 1 ], [ 5, 2 ], [ 5, 3 ], [ 5, 4 ] ] + prts_of_two: "{{ [1,2,3,4,5] | permutations(2) }}" + +RETURN: + _value: + description: List of permutations lists resulting from the supplied elements and list size. + type: list |