Two things (among many others). First, I highly suggest talking to a therapist about this. Both the infidelity and the chronic lying are possibly symptoms of trauma. It is imperative for you to discover "why" you chose to cheat, and why you lie. Often, this is a sign that self-love and self-respect are lacking, as well as healthy boundaries. The good news is, that with some work and therapy, you can learn to overcome the trauma, and to build the things that didn't exist before.
The second is a simple step to get you started, it is what I did and I found it helpful in the beginning. The idea is to make it a priority to NOT lie, and so, to start paying attention to what goes on in your heart and head on a daily basis.
The first step is to "catch" yourself lying, which can be harder than it sounds at first, but gets easier quickly.
Once you catch yourself even feeling as if you might want to lie about something, that's the moment to stop and think about what's going on. What are you feeling at the moment you wanted to lie? What do you think you were trying to accomplish by lying? What would have happened if you told the truth? How do you feel, both emotionally and physically, when you think about how the outcome would have been different if you told the truth? You said you've told your spouse the whole truth now, how did that turn out? Sure, he is angry and hurt, but what about you? Was there a sense of relief in letting the lies out? Does it feel better knowing that you don't have to carry the burden of lies anymore at least?
A lot of us learn to lie, and it is rarely a direct path. Often we lie so that others will think more of us. Or we want to avoid punishment or conflict. Sometimes we do it to manipulate others or to try and control the outcomes. Often it is all of those things.
Finally, just make a promise to yourself to NOT lie moving forward, no big ones, no small ones. Yes, I ate the last cookie. Yes, those jeans make your butt look huge. Yes, I bought AP a gift. Yes, wasn't sick, I just wanted the day off. Whatever it is, just try to be honest. You will fail at first, often. That's okay. When you do, follow the exercises above of figuring out what your motives were.
For me, over time, telling the truth started to become "the norm" and my lying began to diminish. Paying attention to my feelings, I realized that telling the truth, while sometimes hard up front, brought tremendous relief to me. I always knew where I stood, there was never any "I hope they don't ask me about that", there was nothing to hide or be found out, and best of all, by far, it started to increase my own self-respect and self-worth. I felt better about who I was, started to care less what others thought of me because I knew exactly who I was, and so on.
This is a tremendous opportunity for you. As for your husband, well, I cannot predict anything. You might be honest to a fault and it may not change his mind. BUT, at least by doing this work, you will be making yourself a safer person for him to be around, and in my opinion, there is simply no better way to give a reason to stay and try. Remain a liar, and that reason goes away.
Best of luck to you.