The Andy Griffith Show - Season 3 Episode 18 The Loaded Goat Nip it in the bud!
Overview: 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.