# Ansible - Failed to add the host to the list of known hosts

**URL:** <https://forum.ansible.com/t/ansible-failed-to-add-the-host-to-the-list-of-known-hosts/28680>\
**Category:** Ansible Developer\
**Created:** [September 28, 2018, 11:09pm UTC](https://forum.ansible.com/t/ansible-failed-to-add-the-host-to-the-list-of-known-hosts/28680 "2018-09-28T23:09:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riahi\_Mohamed-Amine](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@Riahi\_Mohamed-Amine](https://forum.ansible.com/u/Riahi_Mohamed-Amine)\
**Post date:** [September 28, 2018, 11:09pm UTC](https://forum.ansible.com/t/ansible-failed-to-add-the-host-to-the-list-of-known-hosts/28680/1 "2018-09-28T23:09:44Z")

</div>

Hi

i’m trying to run may first playbook with become\_user : cftadmin and i got this error msg :

fatal: [ANS\_IAWGAP01]: FAILED! =\> {“changed”: false, “module\_stderr”: “Failed to add the host to the list of known hosts (/tmp/$USER/ansible/configuration/known\_hosts).\r\nSorry, user C405372 is not allowed to execute ‘/bin/sh -c echo BECOME-SUCCESS-yzuuugnflqcoylvtkjanapdugeokgrat; /usr/bin/python’ as cftadmin on iawgap01.\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 1}

i tried pipeline = True in ssh section :

ssh\_args = -o GSSAPIAuthentication=yes -o UserKnownHostsFile=/tmp/$USER/ansible/configuration/known\_hosts  
scp\_if\_ssh=True  
pipelining = true

but i still have the problem …

can someone help me please ?

---

<div class="post-metadata">

**Author:** ![AnsibleDev](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@AnsibleDev](https://forum.ansible.com/u/AnsibleDev)\
**Post date:** [September 29, 2018, 12:41pm UTC](https://forum.ansible.com/t/ansible-failed-to-add-the-host-to-the-list-of-known-hosts/28680/2 "2018-09-29T12:41:09Z")

</div>

Hi,

- Is cftadmin user present in both master and node ?- Have you generated ssh key for cftadmin on master and did ssh-copy-id to node system ?
- Have you set “PasswordAuthentication yes” in /etc/sshd/sshd\_config file and restarted sshd service ?
- Is “ansible all -m ping” returning pong for the node you are are trying to connect ?

I followed the below youtube link to run my first Ansible playbook and it went through smooth.  
[https://www.youtube.com/watch?v=79xFyOc\_eEY](https://www.youtube.com/watch?v=79xFyOc_eEY)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![AnsibleDev](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@AnsibleDev](https://forum.ansible.com/u/AnsibleDev)\
**Post date:** [September 29, 2018, 12:44pm UTC](https://forum.ansible.com/t/ansible-failed-to-add-the-host-to-the-list-of-known-hosts/28680/3 "2018-09-29T12:44:42Z")

</div>

Looks like the youtube link is not displayed properly in the post because the admin might have removed it. In youtube, you can search for “Ansible Installation & Configuration on AWS | Ansible basics | install & configure Ansible on EC2” topic by Valaxy Technologies.
