String alignments

Hi Team,

I am redirecting debug messages output to a ‘’ Txt" file using jinja2 templating alignment( by replacing extra strings ). Basically I want to send that file contents to email but output is not looking decent.

Is there any way to include python script in ansible playbook for string alignments. Suggestions please.

Thanks,
Gopal

Try "Filter plugins"
https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#filter-plugins

Cheers,

  -vlado

There are already several filters for text - maybe an existing one would do what you need? You can look at https://docs.ansible.com/ansible/devel/user_guide/playbooks_filters.html for some pointers.

Hope this helps,
Alicia

I’ve created a variable from stdout_lines and the contents are copied into a file through blockinfile module along with jinja template for loop.

The for loop iterates 40 lines. But how do add new line after every 10 lines in jinja template for loop. Like a excel sheet.

Thanks, Gopal

I've created a variable from stdout_lines and the contents are copied into a file through blockinfile module along with
jinja template for loop.

The for loop iterates 40 lines. But how do add new line after every 10 lines in jinja template for loop. Like a excel
sheet.

Thanks, Gopal

Please elaborate on what is your real objective. Without any further information it seems quite futile to me to guess
your problem.

Regards
            Racke

I am using jinja2 expressions to iterate a 40 lines list. Basically my objective is, how do I iterate first 10 lines In first column and there after another 10 lines in second column?

Thanks,
Gopal

I am using jinja2 expressions to iterate a 40 lines list. Basically my objective is, how do I iterate first 10 lines In
first column and there after another 10 lines in second column?

Thanks,
Gopal

Do you mind to share your playbook / tasks and a sample for the list?

Regards
        Racke