Discipline in life requires an element of doing tasks even when not in the mood for doing them.
However, one needs to be in the mood for such a discipline in the first place, i.e. one needs to be in the mood to do things despite not being in the mood for doing those things!
As I wrote in my post Initiating and Producing, starting a task arguably presents the hardest resistance - as procrastinators know well since they are prone to push off and delay getting started with what needs be done.
It is also possible and not uncommon that when one uses will-power to start a given task - such as, say, practicing piano scales - the activity, once started, will put us in the mood for continuing to do it, even though one was far from being in the mood for the task before embarking on it.
At any rate, it is probably fair to say that the more one is disciplined in applying discipline, i.e. doing things when not in the mood for them, the easier maintaining such a discipline becomes and the more one gets done regardless of mood vagaries.
But this reiterates my earlier point that one needs to have a mood for discipline at the start or, failing that, be disciplined about being disciplined, i.e. doing things despite not being in the mood for them and not being in the mood for doing those things in the absence of a desire to do them.
The need for discipline can of course be reduced when one has refined the art of putting oneself in the mood for a task and has learnt to create desire for doing those tasks - e.g. wanting to practice piano by listening to piano music - or, failing that, desire for the discipline of doing those tasks even when not desirous of the tasks themselves, a desire which can spring from a healthy sense that accomplishment takes repeated and habitual care, attention and application and cannot be rendered slave to the whims of one's mood dispositions and temperamental ebbs and flows without suffering a great deal as a result, not least in terms of output.