On 09.05.2019 18:45, Ron Gebauer wrote:
> Hi,
>
> I want to fix the Ansible Linter issue "*[204]* Lines should be no longer
> than 160 chars".
In my opinion the best this is often to disable the to long line check.
> But how I can linebreak filters?
>
> local_filters_in_templates_list: "{{ local_filters_in_templates.files |
> map(attribute='path') | map('regex_replace','^(.*)/') |
> map('regex_replace','.j2$') | list }}"
>
> simply break after "|"?
If you use multiline yaml you can break anywhere you can have a space.
So this is valid
local_filters_in_templates_list: >
{{ local_filters_in_templates.files
|
map(attribute='path')
|
map('regex_replace','^(.*)/')
|
map('regex_replace','.j2$')
|
list }}
Of course this is not very readable, so break it where you like it to be.
And it's important not to use the double quotes when using the multiline, if
you do it will be a string and not a list.
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/7c6d3a2f-1228-6a3c-0a19-26783bbddadf%40olstad.com.
For more options, visit https://groups.google.com/d/optout.