Yes, Those Are Cigarette Machines.
Smoking, and smoking public in particular, is far more common in Germany than you might be used to as an American who first arrives over here. Whether it's at bars, the outside seating areas of restaurants, the "smoking rooms" of a club, or just on the street in general, smoking is far more socially and legally accepted. As a result, cigarette machines are a common enough sight, be it in the back of a restaurant or bar, on the side of a building, or just free standing in some residential areas.
Before you go thinking that just anyone can go up to the machine, pop in a few coins, and out the cigarette pack would come (don't they have age restrictions?!), they do in fact have age checking. Someone attempting to use the machine has to insert a valid ID card (which all Germans carry past the age of 16), which would prove that they are over 18, or insert their debit card, which is capable of doing the same. In some restaurants and bars, their machines don't check for age, but typically these are only found in places which cater to adults, or check patron's ages at the door.
In the past few years that I've been living in Germany, the number of people I've actually seen using the machines has been altogether low. The average person is more likely to go to a grocery store or some other small shop, and as well, the number of people who do smoke in Germany has been decreasing in recent years, particularly amongst young people, which is a good thing for public and individual health. That being said, just over a quarter of Germans on average do smoke, and you will see cigarettes and bulk tobacco being sold far more commonly and openly than is often allowed these days in the U.S..