If I understood you correctly, you have some standard blocks that need
to be present on most of the hosts, but almost every host has different
final concatenated configuration file?
For example, you have blocks:
block1
block2
block3
block4
host1block1
host1block2
host2block1
host3block1
You could name the files something like that on the master, and then use
generate() in your manifest. You would pass $::fqdn to generate script,
which runs on master, takes all of the blocks and builds final file
which will be shipped to a node. For example:
if generate('/etc/puppet/modules/costa/scripts/generate_file.sh',$::fqdn) {
file {'/var/tmp/auto.direct':
source => "puppet:///files/${::fqdn}/auto.direct",
}
}
generate_file.sh script could look something like this:
#!/bin/bash
# standard for all hosts:
cat block1 >> /etc/puppet/files/$HOSTNAME/auto.direct
cat block2 >> /etc/puppet/files/$HOSTNAME/auto.direct
cat block3 >> /etc/puppet/files/$HOSTNAME/auto.direct
cat block4 >> /etc/puppet/files/$HOSTNAME/auto.direct
HOSTNAME="$1"
for i in `ls /etc/puppet/modules/costa/files/fragments | grep $HOSTNAME`; do
cat $i >> /etc/puppet/files/$HOSTNAME/auto.direct
done
If that solution is not good for your particular case, I suggest you
rewrite automount startup script, so that on each (re)start and refresh
it removes automount.conf and concatenates all files from "automount.d"
into new config file. That way your puppet manifest would be really
clean and readable, and you would only push building blocks as files and
not the finished configuration file.
That kind of solution Samba developers suggest to those who dare to ask
when and if they will develop/implement "samba.d" behaviour :)