Rule 24: Obstructions
Your ball lies next to a sprinkler head, an electric box, a 150-yard post or another man-made object typically found on a golf course. What do you do? These objects are considered obstructions (Rule 24), and you're entitled to relief without penalty if your ball, stance or swing is interfered with by an obstruction. But check to see if the object can be moved without delaying play or causing damage. Some yardage posts, for example, can easily be moved. If you can move the obstruction, and your ball isn't touching it, move the object and play on. If your ball moves specifically because of the movement of the obstruction, you can replace the ball without penalty.
If the obstruction can't be moved (your ball is resting on a sprinkler head, for example), drop within one club-length of the nearest point of relief but no closer to the hole.
The procedure differs if the ball lies on the putting green. Place the ball on the nearest point of relief, even if that's off the putting green. If your ball is in a bunker, you're entitled to relief from an obstruction but only if you drop inside the bunker. If you drop outside the bunker, you receive a one-stroke penalty.