Jinja2 Configuration Concern with {{ fqdn_hostname }} and .conf file
14 views
Skip to first unread message
Heather Luna
unread,
Dec 28, 2017, 1:30:32 AM12/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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!
Andreas Olsson
unread,
Dec 28, 2017, 1:52:37 AM12/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
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?