# lineinfile changes symbolic link to file

**URL:** <https://forum.ansible.com/t/lineinfile-changes-symbolic-link-to-file/15642>\
**Category:** Ansible Project\
**Created:** [July 10, 2014, 2:35pm UTC](https://forum.ansible.com/t/lineinfile-changes-symbolic-link-to-file/15642 "2014-07-10T14:35:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [July 10, 2014, 2:35pm UTC](https://forum.ansible.com/t/lineinfile-changes-symbolic-link-to-file/15642/1 "2014-07-10T14:35:27Z")

</div>

I am not sure if this is a feature or a bug. I’m using ansible to update tnsnames.ora - pre-run we have

lrwxrwxrwx 1 oracle dba 17 Sep 24 2012 tnsnames.ora → /etc/tnsnames.ora

I then run something like  
lineinfile: dest=/apps/ora/product/11.2.3.4/network/admin/tnsnames.ora regexp=“{{ environment\_name }}” line=“{{ environment\_name }}=(DESCRIPTION-oracle-etc-blah)”

The link is gone, and there is a file instead:  
-rw-rw-r-- 1 oracle dba 356 Jul 10 14:28 tnsnames.ora

---

<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:** [July 11, 2014, 10:24pm UTC](https://forum.ansible.com/t/lineinfile-changes-symbolic-link-to-file/15642/2 "2014-07-11T22:24:03Z")

</div>

Seems like it should follow links.

Can you please file a bug for this?

Thanks!
