| Server IP : 172.67.134.116 / Your IP : 216.73.217.22 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.9/site-packages/ansible/plugins/filter/ |
Upload File : |
DOCUMENTATION:
name: zip_longest
version_added: "2.3"
short_description: combine list elements, with filler
positional: _input, _additional_lists
description:
- Make an iterator that aggregates elements from each of the iterables.
If the iterables are of uneven length, missing values are filled-in with I(fillvalue).
Iteration continues until the longest iterable is exhausted.
notes:
- This is mostly a passhtrough to Python's C(itertools.zip_longest) function
options:
_input:
description: Original list.
type: list
elements: any
required: yes
_additional_lists:
description: Additional list(s).
type: list
elements: any
required: yes
fillvalue:
description: Filler value to add to output when one of the lists does not contain enough elements to match the others.
type: any
EXAMPLES: |
# X_fill => [[1, "a", 21], [2, "b", 22], [3, "c", 23], ["X", "d", "X"], ["X", "e", "X"], ["X", "f", "X"]]
X_fill: "{{ [1,2,3] | zip_longest(['a','b','c','d','e','f'], [21, 22, 23], fillvalue='X') }}"
RETURN:
_value:
description: List of lists made of elements matching the positions of the input lists.
type: list
elements: list