I have a hard enough time getting money out of an ATM let alone bars of gold. If you're in Dubai however, you won't have that problem. The land of sand, oil and gold has made taking the last one home with you as simple as going to the mall.
(Below: That is not a desert mirage, it's an actual gold-dispensing ATM! Accepts all major forms of payment for gold at market prices)
I came across my first Gold-dispensing ATM machine at the Dubai mall and for just 6,370 AED ($1,734 USD) I could have my very own 1 ounce gold coin with a Kangaroo stamped on it. Not sure where they got the Kangaroo idea from, but still very cool. And if you're not willing to fork over $1700 USD, not to worry, there is gold for everyone! You can buy a 2.5, 5 or 10 gram gold bar for $193, $343 and $638 respectively. Although you won't get a Kangaroo on it.
The ATM monitors the daily price of gold and adjusts the onscreen price accordingly. And yes they take all major forms of payment, including your ATM card.
(Below: Choose how much gold you want and the design. The ATM will show you the current price of gold, so you won't get any deals at this machine! See my post on the Gold Souk for where to shop for gold when in Dubai)
(Below: There is a range of designs to choose from that can be printed on your gold coin)