I would like, if it's possible, to not change the task itself, only the variables.
Thank you, Have a nice day even in these difficult times Le lundi 23 mars 2020 17:42:29 UTC+1, Quentin Aveno a écrit : > > Hi ! > Is there any way to omit a item in Citer le message d'origine > <javascript:;>a list at the declaration ? > > - name: "Test" > hosts: localhost > vars: > test1: false > test2: > - name: test21 > includes: > - { file: "file221.j2", path: "/somewhere/" } > - { file: "file222.j2", path: "/somewhere/" } > - "{{ ( test1 | ternary ({ 'file': 'file223.j2', 'path': > '/somewhere/' }, *omit*) ) }}" > tasks: > - debug: > var: test2 > - debug: > msg: "{{ item.1.path + item.1.file }}" > with_subelements: > - "{{ test2 }}" > - "includes" > Le lundi 23 mars 2020 17:42:29 UTC+1, Quentin Aveno a écrit : > > Hi ! > Is there any way to omit a item in a list at the declaration ? > > - name: "Test" > hosts: localhost > vars: > test1: false > test2: > - name: test21 > includes: > - { file: "file221.j2", path: "/somewhere/" } > - { file: "file222.j2", path: "/somewhere/" } > - "{{ ( test1 | ternary ({ 'file': 'file223.j2', 'path': > '/somewhere/' }, *omit*) ) }}" > tasks: > - debug: > var: test2 > - debug: > msg: "{{ item.1.path + item.1.file }}" > with_subelements: > - "{{ test2 }}" > - "includes" > -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a0cd89a3-48b7-4a9b-a79c-a030a444270b%40googlegroups.com.