# Get rid of "previous known host file not found"

**URL:** <https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427>\
**Category:** Ansible Project\
**Created:** [January 26, 2014, 1:14pm UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427 "2014-01-26T13:14:28Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![John\_Bond](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@John\_Bond](https://forum.ansible.com/u/John_Bond)\
**Post date:** [August 22, 2014, 11:40am UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/21 "2014-08-22T11:40:00Z")

</div>

Just adding a comment for the archives

I just ran into this problem using ansible 1.4.4 from cron. I fixed the issues by running my cron job with

USER=username /usr/bin/ansible …

it might be better to use

import getpass  
…  
user\_host\_file = os.path.expandvars(“~{}/.ssh/known\_hosts”.format(getpass.getuser()))

although looking at trunk i think the current version would now work from cron

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 22, 2014, 11:55am UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/22 "2014-08-22T11:55:05Z")

</div>

Ansible 1.4.4 is somewhat out of date at this point, the most recent update is 1.7.1 and is important that you upgrade since it contains a few security fixes.  
You’ll also be missing a lot of fixes/improvements, modules, and options.

If you have a problem in 1.7.1, do let us know!

---

<div class="post-metadata">

**Author:** ![John\_Bond](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@John\_Bond](https://forum.ansible.com/u/John_Bond)\
**Post date:** [August 22, 2014, 4:29pm UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/23 "2014-08-22T16:29:54Z")

</div>

No problem im just using the stock release in ubuntu LTS 12.04. I will look at creating my own package shortly as i have already come across some other features that are missing in this version.

Thanks John

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 22, 2014, 4:31pm UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/24 "2014-08-22T16:31:11Z")

</div>

You can add our PPA as indicated in [http://docs.ansible.com/intro\_installation.html#latest-releases-via-apt-ubuntu](http://docs.ansible.com/intro_installation.html#latest-releases-via-apt-ubuntu) if you like…

---

<div class="post-metadata">

**Author:** ![John\_Bond](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@John\_Bond](https://forum.ansible.com/u/John_Bond)\
**Post date:** [August 22, 2014, 4:34pm UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/25 "2014-08-22T16:34:47Z")

</div>

Great thanks ill look at that on monday

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [August 22, 2014, 4:37pm UTC](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427/26 "2014-08-22T16:37:09Z")

</div>

​+1, especially on precise, as it needs a backported package too.​

[Previous page](https://forum.ansible.com/t/get-rid-of-previous-known-host-file-not-found/14427.md?page=1)
