I am using the lineinfile module to define the SMART_HOST value in a
sendmail.mc file. I have tried many variations of specifying the 'line=' value, but all generate almost but not quite correct results.
For example: lineinfile: dest=/etc/mail/
sendmail.mc state=present regexp='SMART_HOST' line="define(`SMART_HOST', `{{smarthost}}')dnl"
generates: define(\`SMART_HOST', \`
gateway.here.com')dnl
Or: lineinfile: dest=/etc/mail/
sendmail.mc state=present regexp='SMART_HOST' line='define(`SMART_HOST'', `{{smarthost}}'')dnl' (that is two single quotes)
generates: define(`SMART_HOST, `
gateway.here.com)dnl
And: lineinfile: dest=/etc/mail/
sendmail.mc state=present regexp='SMART_HOST' line="define(`SMART_HOST"'", `{{smarthost}}"'")dnl" (double quote, single, double)
generates: define(`SMART_HOST", `
gateway.here.com")dnl
And so on. Everything I have tried either comes close or just totally fails. The result I am looking for is: define(`SMART_HOST', `
gateway.here.com')dnl
Does anyone know the proper quoting and escaping required to achieve this through YAML?
Thanks,
-Mark