# check for FQDN

**URL:** <https://forum.ansible.com/t/check-for-fqdn/21615>\
**Category:** Ansible Project\
**Created:** [May 31, 2016, 7:19pm UTC](https://forum.ansible.com/t/check-for-fqdn/21615 "2016-05-31T19:19:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John.1209](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@John.1209](https://forum.ansible.com/u/John.1209)\
**Post date:** [May 31, 2016, 7:19pm UTC](https://forum.ansible.com/t/check-for-fqdn/21615/1 "2016-05-31T19:19:30Z")

</div>

I need to ensure that the /etc/sysconfig/network file contains the FQDN on a good number of hosts. I think the lineinfile module would be helpful here. But I’m sure how to write the Ansible script to do so. Any advice?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 31, 2016, 7:34pm UTC](https://forum.ansible.com/t/check-for-fqdn/21615/2 "2016-05-31T19:34:01Z")

</div>

Start with:  
[https://gist.github.com/muloka/7687250](https://gist.github.com/muloka/7687250)  
[https://docs.ansible.com/ansible/lineinfile\_module.html](https://docs.ansible.com/ansible/lineinfile_module.html)

Rough draft (untested):
