leftover on AMI after using Ansible with Packer

Hello,
I use Ansible to configure OS which is base for Packer to create AMI
for AWS and disk image for Azure. AMI bases on Amazon Linux and Azure
image on Ubuntu image. The whole process works fine, however somehow
on AMI in /home/ec2-user there is (an empty) ~wawrzek/.ansible/tmp
directory. 'wawrzek' is a name of the user triggering packer +ansible
task. Azure is OK.

Any idea what might be wrong?

Wawrzek

That folder is a temporally folder used by ansible. See the following for more details

https://docs.ansible.com/ansible/2.4/intro_configuration.html

local_tmp

New in version 2.1.

When Ansible gets ready to send a module to a remote machine it usually has to add a few things to the module: Some boilerplate code, the module’s parameters, and a few constants from the config file. This combination of things gets stored in a temporary file until ansible exits and cleans up after itself. The default location is a subdirectory of the user’s home directory. If you’d like to change that, you can do so by altering this setting:

local_tmp = ~/.ansible/tmp

Ansible will then choose a random directory name inside this location.