# create transport map - all lines the same but one

**URL:** <https://forum.ansible.com/t/create-transport-map-all-lines-the-same-but-one/14539>\
**Category:** Ansible Project\
**Created:** [February 11, 2014, 10:01am UTC](https://forum.ansible.com/t/create-transport-map-all-lines-the-same-but-one/14539 "2014-02-11T10:01:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Patermann](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marc\_Patermann](https://forum.ansible.com/u/Marc_Patermann)\
**Post date:** [February 11, 2014, 10:01am UTC](https://forum.ansible.com/t/create-transport-map-all-lines-the-same-but-one/14539/1 "2014-02-11T10:01:43Z")

</div>

Hi,

I have a postfix transport table on all the mailservers.  
The file is pretty the same, but the line pointing the the very server this file is on, is deactivated (by comment or by deleting).

What would be the sanest way to build this in ansible?

A template would be one option, but there must be an if condition to each line, which seems a lot of overhead to me.

Marc

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [February 11, 2014, 12:54pm UTC](https://forum.ansible.com/t/create-transport-map-all-lines-the-same-but-one/14539/2 "2014-02-11T12:54:51Z")

</div>

use template and generate the lines, with a single IF that skips ansible\_hostname or ansible\_fqdn (from facts).
