ansible unarchive – file not found

This strange thing happened where I tried this :

- name: Extract archive
  unarchive: src=src/dir/file.ext dest=dest/dir

It started complaining that “input file not found atĀ src/dir/file.ext”. After trying out a lot of options like checking file path, checking permissions, I finally found from this stackoverflow post that “copy=no” would do the magic. So basically it was searching in the host machine, rather than the remote. Hence this worked

unarchive: src=src/dir/file.ext dest=dest/dir copy=no

Simple !


Ansible Password-less sudo

It gets tricky when you have to escalate an user and the machine doesn’t require a password as such. ‘become’, ‘become_pass’ or anything does not work. You might encounter this error :

“Timeout (62s) waiting for privilege escalation prompt:”

in those cases try using :

sudo: yes

And dont club it with anything else. Hope it works !