Hey @Blendash ,
Here's an idea, to prevent sliding of the cylinders; just make the cylinders and their connection one Object.
Parent the whole thing to an Empty, animate the Empty's Rotation and let that drive the Rotation of the Object, something like this:

If the Cylinders need to be separate for some reason, you can Parent them to the connecting piece.