A former youth pastor who admitted to inappropriately texting sexually explicit messages to teenage boys will serve six months in jail for his crimes.