The Andy Griffith Show
The Loaded Goat (3x18)
:
Cy Hudgins has a pet goat with a taste for dynamite and Andy and Barney are forced to put it in a padded cell until the danger "passes." But when Otis unknowingly lets their new prisoner out, it's up to Barney and his harmonica to safely lead the goat out of town.