Talking to reporters on his return from his two-nation visit of Nigeria and Mali, he said, "The prime minister had said 'we will do it and do it in the time and method of our choosing'.
"How you do that is something left to the judgement of the government and the professionals in charge of this."
Mr Ansari said, you "can't be the recipient of terrorist attacks all the time and do nothing about it. Government has stated very clearly why action was necessary, terror launch pads were identified and taken care of".
He said both the African countries he visited also expressed their resolve in fighting terrorism.
"Both Nigeria and Mali have seen very serious terror attacks, many of which crossed national borders," he said. He also said that India wants restructuring of the legal framework by adopting a comprehensive convention on international terrorism.
Both Nigeria and Mali are members of OIC. Mr Ansari said the Malian leadership apprised him that the West African country will not be party to any anti-India stand.
During his address to the National Defence College in Nigerian capital Abuja too, Mr Ansari had stressed on the need for societies that stand for peace and humanism to increase their cooperation and strengthen efforts to prevent supply of arms to terrorists, disrupt terrorist movements, and curb and criminalise terror financing.