In the past few seasons, the Rangers’ front office rolled the dice and went all-in on trade-deadline deals as management sensed the end of an era approaching.

Consider: Martin St. Louis, Keith Yandle and Eric Staal were acquired for high draft picks and prospects. But none of them helped the Rangers raise the elusive Stanley Cup.

Between those transactions and the burden of many tough- to-move long-term contracts, the Rangers will have a tough task retooling and reshaping the roster. That begins now because the Penguins dispatched them in five games in the first round of the playoffs.

VoteRangers 2016-17: Keep 'em or dump 'em?

It won’t be easy. And it’s only getting tougher to finish in the top eight in the Eastern Conference.

The teams at the top of the Metropolitan Division (the Capitals and Penguins, who will face each other in the second round) will come back strong next season. The Islanders finished one point behind the Rangers and won all four meetings this season. And the two Florida teams in the Atlantic Division are on the rise.

There’s also this: The Rangers have no first- or second-round picks in this June’s entry draft and their Metro opponents (the Islanders, Flyers, Hurricanes, Blue Jackets and Devils) already have better prospects in their system, according to The Hockey News’ Future Watch team rankings.

advertisement | advertise on newsday

Here’s a quick look at the roster, which might be squeezed by the salary cap in 2016-17, as it was this season.

Goaltending: No. 1 netminder Henrik Lundqvist, 34, who struggled at times this season behind a shaky defense, will be back. Antti Raanta is a capable, inexpensive backup who might be offered another one-year contract.

Defense: Major issues here. Captain Ryan McDonagh will return. Presumably, so will Marc Staal, who has five years left on a contract with an annual cap charge of $5.7 million. Rookie Brady Skjei, who fared well in the playoffs, is a keeper. Dan Boyle, who is 39 and didn’t deliver enough to justify his two-year, $9-million contract, won’t be offered another.

But there are hard choices about other players. Yandle will be one of the most-pursued free agents. Should the Rangers offer another long-term deal to the biggest offensive threat on the blue line?

The wear and tear on iron man Dan Girardi, 31, began to show, making the four years and a cap hit of $22 million left on his contract a growing problem. A buyout is based on salary ($15 million), not the cap hit, and is paid over twice the number of years (in Girardi’s case, eight) and at a rate of two-thirds of the total salary, which might not make it feasible for the Rangers. A trade would be difficult.

Kevin Klein is affordable at $2.9 million annually, but that might make him a trade candidate. Rookie Dylan McIlrath should be kept, but coach Alain Vigneault appears to wonder if he is ready for a full-time role.

Offense: The Rangers’ top four forwards (Derick Brassard, Derek Stepan, Rick Nash and Mats Zuccarello) have a $23.8-million cap hit. And there are three restricted free agents: Chris Kreider, Kevin Hayes and J.T. Miller. Along with Boyle, losing unrestricted free agents Eric Staal, Dominic Moore and Viktor Stalberg will clear some cap space. But there is no doubt: The Rangers are in a bind to restructure their roster.