Could post or link a tasker profile?
I could not get it to work.
I think Tasker needs Root access to reboot the phone.
Mine puts the phone to silent mode for any power, so not sure if you want my exact profile.
Here is how to do it if you want a restart after unplugging.
New Profile - name it if you want
Hit State under First Context
Hit Power under Select State Category
Hit Power under Select Power Action
Leave the Source as Any under Power
Hit the Check
Hit new Task under Task Selection - name it if you want
Hit the +
Hit Tasker under Select Action Category
Hit Wait under Select Tasker Action
Change ms to 1 (so will be 1 milisecond)
Hit the Check
Hit the Task you just created in the profile you just created
Under Task Options hit Add Exit Task
Hit New Task under Task Selection - name it if you want
Hit the + in Task Edit
Hit Misc under Select Action Category
Hit Reboot under Select Misc Action
Hit the Check
Hit the next Check
Now you should have a profile that will just wait 1 ms (essentially does nothing) when you plug in power, and then will reboot your phone when the state changes to no power (unplugged).
Since I just did it to do this walk through I'll get the profile up here
Edit: Added the profile. Just unzip it and drop it in sdcard/tasker/profiles
From there you should be able to import it pretty easy.