set_fact: module: how to use args for complex argumets?

363 views
Skip to first unread message

Erik Steffl

unread,
Jul 22, 2015, 9:28:37 PM7/22/15
to Ansible Project
Ansible set_fact documentation http://docs.ansible.com/ansible/set_fact_module.html says "Or alternatively, accepts complex arguments using the args: statement". How do I use "args"?


So far I figured out that this works (using it in tasks array):


{
  "local_action": {
    "module": "set_fact",
    "git_version": "HEAD"
  },
}

which is almost great but this way of specifying variables does not allow to set variable names "module" given that "module" is the name of the module.

When I use "args" as a key it just becomes a variable...

Is there a better way to specify a dictionary/map for the module (using the style above. not the other one where the module name is the main key).

Thanks!

erik
Reply all
Reply to author
Forward
0 new messages