Getting module failure while creation file on AT

Hi All,

Need your guidance.

I am trying to create a file on Ansible Tower local host.

Below is the task which syntax

Task synatx

  • name: create some file
    file: path=/tmp/risratho.txt state=touch mode=‘0755’
    delegate_to: localhost

i would like to rephrase my word on ansible tower it is giving below error.

fatal: [80.0.20.219 → localhost]: FAILED! => {
“changed”: false,
“module_stderr”: “/bin/sh: sudo: command not found\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 127
}

Make sure you have correct permission. Most case you will not have root access in tower server . Use become:false in task level to create the file as it’s delegate to localhost.

//Vinoth