Because the generic and preseed_master are generated automatically by the template engine Tempita we could access the objects from django / python and decide which parts of a preseed-script is called.
I'm for example created some zones (production, staging) and use different mirrors for the resource that is required. I've modified the generic file to add an extra definition:
{{def example}}
# set repository based on zone name
#·{{node.zone}}
{{if node.zone.name in {'staging',} }}
d-i apt-setup/local0/repository string deb https://repo.example.com/ubuntu staging/
d-i apt-setup/local0/comment string staging repository
d-i apt-setup/local0/key sting http://repo.example.com/repo.key
{{endif}}
{{if node.zone.name in {'production',} }}
d-i apt-setup/local0/repository string deb https://repo.example.com/ubuntu production/
d-i apt-setup/local0/comment string production repository
d-i apt-setup/local0/key sting http://repo.example.com/repo.key
{{endif}}
d-i apt-setup/local1/repository string deb https://repo.example.com/ubuntu common/
d-i apt-setup/local1/comment string common reposiotry
d-i apt-setup/local1/key sting http://repo.example.com/repo.key
d-i pkgsel/include string git jenkins-slave jenkins-scripts ntp
{{enddef}}
This definition could easily called in the preseed_master file via:
{{self.example}}
You could access all node information with the object node. All object / module details could be checked in the source code on /usr/lib/python2.7/dist-packages/maasserver/models/node.py