Bring a large pot of water to a boil.
In a large skillet over medium-high, heat the EVOO, three turns of the pan. Separate the strips of salami as you scatter them into the pan. Cook, tossing with tongs, until crisp, 2 to 3 minutes, then transfer to a plate. Reduce the heat to medium and stir in the sliced fennel, onion, garlic, thyme and fennel seeds; season with salt and pepper. Zest the lemon over the fennel mixture. Cook, tossing occasionally, until the fennel and onions are very tender and beginning to brown, about 12 minutes. Deglaze the pan with the Pernod, if using, then add the stock and beans and heat through. Just before serving, squeeze in the juice of half the lemon for brightness.
When the water is at a rapid boil, salt it and cook the spaghetti until al dente, 7 to 8 minutes. Drain, reserving half a mug of the cooking water. Add the pasta, reserved cooking water and salami to the fennel mixture. toss in the fennel fronds and season. Drizzle with EVOO, to taste. Serve with the grated cheese to pass around the table.