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)