Technically, it is ambiguous but practically, the first meaning is the only one that will be understood unless the context strongly suggest otherwise (eg. J’ai à boire ça ?)
To express the "to be obliged to" meaning, we would say:
Je dois boire.
Il faut que je boive.
Il me faut boire.