Most Ansible users have come across the args
keyword when using the ansible.builtin.command
module. In this case the args
keyword is used to pass a named parameter such as chdir
or creates
to the module that accepts a "free form" parameter.
Example:
- ansible.builtin.command: touch filename #Run this command
args:
chdir: /some/path # Change to this path before running command
creates: /some/path/filename # The command creates this file
What you might not know is that the args
keyword can be used on any module for a number of different use cases . Here are some examples: