I am building a custom action plugin and I am trying to invoke the command 
module using ActionBase._execute_module. But unfortunately, I couldn't find 
any document or samples showing how to pass the command to module_args 
parameter. I set _raw_params value to my command and got it working. But I 
am not sure if that is the recommended approach. Below is the code I am 
talking about. It would be great if someone could point me to the right 
usage of this module programmatically

cmd = 'ls -a'
command_task.args["_raw_params"] = cmd
command_task.args['_uses_shell'] = True
module_return = self._execute_module(module_name='command', 
module_args=command_task.args, task_vars=task_vars)

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0bca3f2a-04da-44bc-9a80-82539fb7df61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to