Salt minion_id refresh

Hi,
does anybody have integrated the salt-minion in their templates?
How do you handle the minion_id?

Currently I have no clean way. I try to add a Pre command in systemd to overwrite the minion_id at every start.
late-commands:
- sed -i '/^ExecStart=/i ExecStartPre=/bin/bash -c '\''hostname -f > /etc/salt/minion_id'\''' /target/etc/systemd/system/salt-minion.service

For Linux this is not pretty but should work (not tested yet). But for Windows it would be even more tricky.