So a hypothetical Mason Lienart could sit there the entire time thinking, "I do not wish to ordain. I do not wish to ordain." But if he performs the Rite he intends to do the ordination, and therefore to ordain.
This is condemned:
“A Baptism is valid when conferred by a minister who observes every external rite and form of baptizing, but within in his heart, resolves to himself not to intend what the Church does.” - CONDEMNED, (Pope Alexander VIII, Decree of the Holy Office, December 7, 1690, Errors of the Jansenists, Denz., 1318).
Despite this condemnation, Catholics should not be troubled, because as l' Abbe Hunter explains in his manual:
"It is objected to this doctrine that it makes the validity of every Sacrament depend upon a purely internal fact, namely, the intention of the minister who may perform the outward acts with the interior intention of not acting as deputy of Christ. We admit the consequence, but deny that there is anything in it out of harmony with other parts of revealed doctrine; it is perfectly true that, without special revelation, no one can have absolute certainty that he has received a Sacrament or that he is in the state of grace (n. 639): but his assurance on the subject may approach so nearly to this absolute certainty as to make any misgiving on the subject foolish and vain; and it must always be remembered that God, who has bound Himself to give grace when the Sacraments are duly received, has nowhere limited His power, disabling Himself from giving grace apart from these holy rites. One, therefore, who acts in good faith may hope that no disaster will befall himself or those dear to him through the deceit of a wicked minister. (See n. 696.)"