Section 17. Boards or officers having power to take land for school purposes in cities may take, by eminent domain under chapter seventy-nine, land therein not already appropriated to public use, or lease or purchase land either within or without the city limits, for the purpose of section fifteen. A school committee may erect suitable building on land so acquired, and provide, on terms not involving loss to the city, for the use of plots of ground and for the temporary housing of pupils complying with its regulations and not having access to other land suitable for proper instruction.