Bayern Munich have agreed a deal to sign James Rodriguez from Real Madrid on a two-year long, with the Bundesliga champions holding a purchase option on the Colombian star.