Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block: and loop: are mutually exclusive #15

Open
jokjr opened this issue Mar 3, 2022 · 0 comments
Open

block: and loop: are mutually exclusive #15

jokjr opened this issue Mar 3, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jokjr
Copy link
Contributor

jokjr commented Mar 3, 2022

Below an example of invalid syntax; should be easy enough to add linting of this to the code that generates the "more than one module" warnings in jinjalint.py

- name: do lots of things
  loop: "{{ my_collection }}"
  block:
    - name: foo
      debug: msg=foomsg
    - name: bar
      debug: msg=barmsg

Eric Anderson has a neat workaround that we could suggest to the user: https://ericsysmin.com/2019/06/20/how-to-loop-blocks-of-code-in-ansible/

@jokjr jokjr added enhancement New feature or request good first issue Good for newcomers labels Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant