He was born in Dunrine in the Parish of Kilcummin, Killarney in 1933. He was educated at Coolick National School and St. Brendan's College, Killarney. He joined the staff of Kerry County Council in 1952 and worked in Housing, Accounts and Health sections over the next 10 years.
In July 1962, he was appointed as Acting town clerk, Killarney Urban District Council and later appointed Staff Officer in the Health and Hospitals section of Kerry County Council. When the new Planning department of the Council was launched O'Leary was put in charge of this until his resignation and election to Dáil Éireann in 1966.
O'Leary was first elected to Dáil Éireann at the December 1966 by-election to succeed Honor Crowley. Honor Crowley had previously succeeded her husband, Frederick Crowley in 1945. He was re-elected at the 1969 general election and was subsequently appointed to the Dáil Select Committee on Procedures and Privileges from 1969–1973. He also represented the government at the 1st World Conference on the Environment in Stockholm in 1972. He was one of five TDs to attend the funerals of the victims of Bloody Sunday inDerry in 1972.
He was re-elected at the head of the poll at the 1973 general election. He was appointed to membership of the Council of Europe from 1973–1975 on the nomination of the Fianna Fáil Leader Jack Lynch and from 1975–1977 he served as Opposition spokesperson on Physical Planning and the Environment.
He was elected as a member of Kerry County Council in 1974, gaining the 3rd seat for Fianna Fáil in the Killarney area. Again he represented Fianna Fáil at the 2nd World Conference on the Environment held in Kingston, Jamaica in 1976.
He was re-elected at the head of the poll at the 1977 general election. In December 1977 he was appointed Minister of State at the Department of the Environment with special responsibility for Planning, Roads, Water Safety, Housing, Traffic, Water and Sewerage Schemes. He resigned as a member of Kerry County Council in January 1978 and was replaced by P.J. Cronin. He was not reappointed as Minister following the election of Charles Haughey as Taoiseach in December 1979.
He was re-elected at the 1981, February 1982 and November 1982 general elections. He was appointed by Charles Haughey as a member of the New Ireland Forum in 1983 and again in 1984. He stood again for the Kerry County Council elections in 1985 and won a fourth seat for the party in the Killarney area.
At the 1987 general election, he was again elected at the head of the poll before the third Fianna Fáil candidate was eliminated, leaving a pool of over 10,000 votes for John O'Donoghue to gain a second seat for the party. He was subsequently appointed to a number of Joint Oireachtas Committees. He was re-elected at the 1989 general election.
He was re-elected to Kerry County Council at the 1991 local elections. He was re-elected at the 1992 general election and selected as Vice-Chairman of the All-party Foreign Affairs Joint Oireachtas Committee and to the All-party Finance Committee.
He retired as a member of Kerry County Council in March 1996 and as a Member of Dáil Éireann at the 1997 general election. Fianna Fáil selected his son Brian O'Leary to contest the seat. However, it was won by Jackie Healy-Rae who ran as an independent candidate when he was not selected by Fianna Fáil.