rewire ventilation fan to use pull chain instead of wall switch
The switch must be in a listed and labeled enclosure, or the switch itself must have a built-in enclosure. The switch should also be rated for the voltage, and current, to which it will be subjected. 

You'll also want to make sure the switch is attached in such a way, that normal use will not rip it from the enclosure. Pull chains can be subjected to a lot of abuse.