server1
server2
server3
PermitEmptyPasswords no
PermitEmptyPasswords no
PermitEmptyPasswords no
Found
Not Found
Not Found
*But I want output in this format-:*server1, PermitEmptyPasswords no , Found
server2, PermitEmptyPasswords no , Not Found
server3, PermitEmptyPasswords no , Not Found
Try this
- shell: echo
"{{ lines|map('extract', output)|list|join(',') }}"
>> file_output.csv
loop: "{{ range(0, len|int)|list }}"
vars:
step: 3
len: "{{ output|length / step }}"
lines: "{{ range(item, output|length, step)|list }}"