while trying to stop or start service i am seeing an error Interactive authentication required

Hello All,

I am new to ansible ,wrote a playbook to start service i am seeing the below error ,can anyone suggest me

TASK [stop service] ******************************************************
fatal: [172.31.91.173]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Failed to start umountroot.service: Interactive authentication required.\nSee system logs and ‘systemctl status umountroot.service’ for details.\n”}
fatal: [172.31.93.45]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Failed to start umountroot.service: Interactive authentication required.\nSee system logs and ‘systemctl status umountroot.service’ for details.\n”}

Thanks
Sandeep

Hi Sandeep,

i assume you forgot to set

`
ansible_become = true

`

in the ansible.cfg (or in the vars setion).

You are executing systemctl with a unprivilegued user.

Yours, Hans

Hi Hans

I have edited the yml file with become =true in the yml it started to work when i exeucte the playbook using sudo

yml file