Hey;
I don't know if this matches the OP's scenario; but, I've been contemplating something similar during provisioning. To provide context, as you can probably tell from my other posts, I'm just rolling out puppet server after a long absence and even then wasn't exactly an expert.
Like most places, I imagine, I support a reasonably complex environment... different data centers, different environments, different zones (dmz, zone 1, etc).
Quite a bit of my modules that I'm planning on developing will be based on custom facts such as "$ facter auth" returns ldap, local, poss others if mgmt gets its way, "$ facter dc" returns the name of the datacenter.
Short version: Those custom facts won't be available to the modules until the agent's been run once. The "solution" as yet untried is similar to what Rob Nelson suggested ie: have a "build" class(es) that gets applied via the enc that does basic configs, then update the enc with the final config.
I'm certainly open to suggestions if there's a better way.
Thanks
Doug O'Leary