Am I able to take the 30% federal tax credit for putting solar panels on a rental property I own?

Does replacing the roof at the same time qualify for a 30% tax credit?