A serving soldier has thrown his career and liberty into jeopardy after he admitted being a cocaine dealer.