I'm trying to write a task that should be executed once over a list, for example:
- name: Create something that has an attribute with more than one values
some_module:
some_attribute: "{{ item }}"
run_once: true
loop:
- a
- b
But the task written like this will be executed two time, like
- name: Create something that has an attribute with more than one values
some_module:
some_attribute: "a"
run_once: true
- name: Create something that has an attribute with more than one values
some_module:
some_attribute: "b"
run_once: true
What I like to obtain is this:
- name: Create something that has an attribute with more than one values
some_module:
some_attribute:
- a
- b
run_once: true
where "some_attribute" is also a list.
How can I achieve this?
Thanks