# Jinja2 Configuration Concern with {{ fqdn\_hostname }} and .conf file

**URL:** <https://forum.ansible.com/t/jinja2-configuration-concern-with-fqdn-hostname-and-conf-file/26388>\
**Category:** Ansible Project\
**Created:** [December 28, 2017, 6:30am UTC](https://forum.ansible.com/t/jinja2-configuration-concern-with-fqdn-hostname-and-conf-file/26388 "2017-12-28T06:30:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heather\_Luna](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@Heather\_Luna](https://forum.ansible.com/u/Heather_Luna)\
**Post date:** [December 28, 2017, 6:30am UTC](https://forum.ansible.com/t/jinja2-configuration-concern-with-fqdn-hostname-and-conf-file/26388/1 "2017-12-28T06:30:32Z")

</div>

Hello!

I have a configuration (.conf) file that I’m attempting to manipulate by adding the {{ fdqn\_hostname }} ONLY for the serverName piece, the rest of the information like the SSL password is something that’s going to change across my hosts. How do I edit just the one line and keep the rest of the configuration file in tact? I’m concerned that if I use a jinja2 template and simply specify serverName = {{ ansible\_fqdn }} that it’s going to write over the other information and simply keep that one line rendering the rest of the configuration file useless.

Thanks!

---

<div class="post-metadata">

**Author:** ![Andreas\_Olsson](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Andreas\_Olsson](https://forum.ansible.com/u/Andreas_Olsson)\
**Post date:** [December 28, 2017, 6:52am UTC](https://forum.ansible.com/t/jinja2-configuration-concern-with-fqdn-hostname-and-conf-file/26388/2 "2017-12-28T06:52:24Z")

</div>

ons 2017-12-27 klockan 22:30 -0800 skrev Heather Luna:

> I have a configuration (.conf) file that I'm attempting to manipulate  
> by adding the {{ fdqn\_hostname }} ONLY for the serverName piece, the  
> rest of the information like the SSL password is something that's  
> going to change across my hosts. How do I edit just the one line and  
> keep the rest of the configuration file in tact?

Sounds like you are looking for the lineinfile module?

[https://docs.ansible.com/ansible/latest/lineinfile\_module.html](https://docs.ansible.com/ansible/latest/lineinfile_module.html)

// Andreas
