# I cant create a simple .txt file using ansible.

**URL:** <https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197>\
**Category:** Ansible Project\
**Created:** [December 4, 2017, 8:38am UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197 "2017-12-04T08:38:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Mahir](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Muhammad\_Mahir](https://forum.ansible.com/u/Muhammad_Mahir)\
**Post date:** [December 4, 2017, 8:38am UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197/1 "2017-12-04T08:38:03Z")

</div>

Hello there,

I just want to test my script if it creates a simple .txt file into a destination put instead it is creating that same file into the source vm that is where the ansible is installed.

Here is the simple script I’m running.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 4, 2017, 8:42am UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197/2 "2017-12-04T08:42:44Z")

</div>

That's because of the connection line  
[http://docs.ansible.com/ansible/latest/playbooks\_delegation.html#local-playbooks](http://docs.ansible.com/ansible/latest/playbooks_delegation.html#local-playbooks)

---

<div class="post-metadata">

**Author:** ![Muhammad\_Mahir](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Muhammad\_Mahir](https://forum.ansible.com/u/Muhammad_Mahir)\
**Post date:** [December 4, 2017, 12:03pm UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197/3 "2017-12-04T12:03:57Z")

</div>

> Thank you so much for your reply.

I’ve got your point and have removed connection: local from my playbook. But after that a new output appears this time.

[DEPRECATION WARNING]: Instead of sudo/sudo\_user, use become/become\_user and  
make sure become\_method is ‘sudo’ (default). This feature will be removed in  
version 2.6. Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in ansible.cfg.

PLAY [Cassandra] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [10.0.0.243]: UNREACHABLE! =\> {“changed”: false, “msg”: “Failed to connect to the host via ssh: Permission denied (publickey,password).\r\n”, “unreachable”: true}  
to retry, use: --limit @/etc/ansible/playbooks/cassandra-playbook.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10.0.0.243 : ok=0 changed=0 unreachable=1 failed=0

although when I ping 10.0.0.243 it perfectly connects. what can be the issue

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 4, 2017, 3:32pm UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197/4 "2017-12-04T15:32:57Z")

</div>

Your comment "it perfectly connects" indicates you used ansible -m  
ping, but the authentication error suggests you did ICMP ping.

So, which ping did you use?

Thanks

DIck

---

<div class="post-metadata">

**Author:** ![Muhammad\_Mahir](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Muhammad\_Mahir](https://forum.ansible.com/u/Muhammad_Mahir)\
**Post date:** [December 5, 2017, 7:52am UTC](https://forum.ansible.com/t/i-cant-create-a-simple-txt-file-using-ansible/26197/5 "2017-12-05T07:52:52Z")

</div>

I’am using "ansible cassandra -m ping " or "ansible all -m ping " and is can easily ssh also but the moment I run the playbook it shows me this error.
