If you set up a new Mac with a clean installation of OS X Yosemite, then you might find yourself in a situation where the OS X Setup Assistant utility pauses and hangs with the spinning color wheel. This may persist for minutes on end, and have you assuming the setup has failed, requiring you to manually reset your Mac. However, when you do so, the same behavior persists.
This problem happens on some systems when Setup Assistant is configuring the system for use with iCloud, and while the specific reason for the problem is unknown, it can be overcome in a couple of ways.
If you want to expedite this process, then try turning off your Mac’s internet access either by using the Wi-Fi menu that should be available when Setup Assistant is running, or by turning off your Wi-Fi router. The Mac may still pause for a few minutes while it attempts to connect to the internet, but should eventually give up and continue without setting up iCloud services. Once finished, you can use the iCloud system preferences to set up the various iCloud services you want.
Though not recommended, you can also resort to force-restarting your Mac; however, keep in mind that it will still pause when setting up internet services, so be sure to turn off Wi-Fi access immediately when Setup Assistant starts again. Note that if you have already created a user account, then you might need to specify another account if Setup Assistant complains that one of your desired name already exists. In this situation you can use any temporary account name, and when OS X loads you can use the Users & Groups system preferences to re-create your desired one, then log into it, and remove the temporary one.