On Wed, Mar 30, 2022 at 7:01 AM Pavel Cahyna <pcahyna@redhat.com> wrote:
Hi,

On Wed, Mar 30, 2022 at 02:36:59PM +0200, Jörg Kastning wrote:
> Hi,
>
> Running `tox -e yamllint` in my role directory shows that the following
> lines in my tasks/main.yml are too long:
>
> ~~~
> - name: Perform platform/version specific tasks
>   include_tasks: "{{ lookup('first_found', __rolename_ff_params) }}"
>   vars:
>     __rolename_ff_params:
>       files:
>         - "{{ ansible_facts['distribution'] }}_{{
> ansible_facts['distribution_version'] }}.yml"
>         - "{{ ansible_facts['distribution'] }}_{{
> ansible_facts['distribution_major_version'] }}.yml"
> ~~~

Here is an alternate way to do this "define platform/OS specific vars" https://github.com/linux-system-roles/template/blob/master/tasks/main.yml#L8-L21
which confirms to current recommended practices: https://github.com/redhat-cop/automation-good-practices/tree/main/roles#platform-specific-variables

>
> The last two lines are too long. I've attached the code as well, in case my
> MUA messes with the linebreaks here.
>
> How could I solve this? Can I use Multi Line Strings in YAML dictionaries
> too?
>
> Could someone give an example please on how to solve this?

https://github.com/linux-system-roles/timesync/pull/47/files

P.
_______________________________________________
systemroles mailing list -- systemroles@lists.fedorahosted.org
To unsubscribe send an email to systemroles-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/systemroles@lists.fedorahosted.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure