http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%...
Whether it's ironic or not is hard to say. It doesn't really sound like it. First he urges a boy to become skilled in war, then he pictures the boy's fiancee begging him not to fight against the enemy's star fighter -- a lion of a warrior. Then the poet says, "it is sweet and fitting to die on behalf of one's country," and goes on the describe the heroic qualities of personified Virtue in face of opposition.
Horace did claim to have himself thrown away his shield and fled from battle when in the service of the republican cause (the side of Brutus) after the death of Caesar. But he's also picking up on a theme used by early Greek poets, like Alcaeus, so it's questionable how much of this confession is literary trope and how much is historical evidence. Furthermore, Horace had been fighting on the losing side, and he later found it necessary to receive pardon from the victor Octavian (aka Augustus), so better to sound like he supported the republicans only half-heartedly. On the other hand, it might well still be true that he ditched his shield and ran.
The poem dates from after his military experience, and belongs to a collection of poems called the 'Roman Odes' that celebrate Rome and the emperor Augustus.
I think that's mostly correct, but it's been a while since I studied these things.