Replicate mechanical movement
I'm sure there are multiple ways to do it.  Physics are unnecessary (which is nice, because it's faster and easier without them.)

We start with a root bone.  Then we have a rotation control, parented to the root  Then we have a deforming bone for the inner/middle section (depending on if you want the axle handled differently), which is parented to the rotation control.
Finally, we have the bone for the outer section.  This is the only constrained bone.  It is parented to the middle bone, but has inherit rotation disabled.  It is floored in both directions to our root bone, so it only moves side to side with the rotation of the inner body.
There are plenty of constraints we could have used to acquire this behavior.  I just happened to pick floor constraints.