I have a vauxhall viva and with the key out of the ignition the red ignition light stays on. When I turn the key the red light goes out and the green one comes on. Has any one got the answer I have tried checking the earth connection.
Actually, if you read the OP it says that the ignition light stays on with the key out of the ignition.
If the light stays on with the engine running, it indicates a fault in the charging system (alternator, drive belt, connections).
If the light stays on with the key removed, it suggests that the ignition switch is faulty (not turning off). This suggests that the switch may need replacing.