# Playbook task to name a file...

**URL:** <https://forum.ansible.com/t/playbook-task-to-name-a-file/22727>\
**Category:** Ansible Project\
**Created:** [October 6, 2016, 3:58am UTC](https://forum.ansible.com/t/playbook-task-to-name-a-file/22727 "2016-10-06T03:58:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hart](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@Ben\_Hart](https://forum.ansible.com/u/Ben_Hart)\
**Post date:** [October 6, 2016, 3:58am UTC](https://forum.ansible.com/t/playbook-task-to-name-a-file/22727/1 "2016-10-06T03:58:31Z")

</div>

So Im following the blog post here: [http://www.kernel-overload.com/automatic-password-generator-to-work-with-ansible/](http://www.kernel-overload.com/automatic-password-generator-to-work-with-ansible/)

In my situation since I will be using this to change root on about 60 servers and due to security policy we do not want them sent in cleartext via email… I devised a plan:

echo the passwd to a txt file, scp the file to a secured host then rm it on the source. But to help organize the ton of txt files that will be generated I want to name the files to match the remote hostnames of each server. So for example my bash script will be creating ‘pw.txt’ that contains the passwd in cleartext. I’d like, once it’s called, for ansible to rename the file to be _hostname_.txt

Since I’m extremely green at it Im asking here for help. Thanks
