Can I use a dictionary variable to supply all task parameters?
With Ansible 2.2 you can still use args
parameter to achieve that.
But it is deprecated for a while already and will display a warning for you.
Some details about deprecation.
Example:
- hosts: localhost
gather_facts: no
vars:
args_list:
- content: hello world
dest: /tmp/test1.txt
mode: 0666
- content: test test test
dest: /tmp/test2.txt
mode: 0444
tasks:
- copy:
args: "{{ item }}"
with_items: "{{ args_list }}"