I cant create a simple .txt file using ansible.

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.

That's because of the connection line
http://docs.ansible.com/ansible/latest/playbooks_delegation.html#local-playbooks

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

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

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.