Preheat the oven to 425. Heat a large (12-inch) cast iron skillet or a flat bottomed dutch oven over a medium-high heat the garlic still in its peel, turning occasionally until it is soft and blackened in spots.
While you are waiting for the garlic to be ready, pull the chipotle peppers out of the adobo sauce and combine in a blender or food processor with the salt and tomatoes.
When the garlic is ready, peel it and add it to the peppers and tomatoes. Puree until smooth.
Drizzle olive oil in the skillet/dutch oven and add the sausage (if using), breaking up into crumbles and brown it over a medium heat. When the sausage is done, remove it to a bowl.
While the sausage is cooking, slice your potatoes and onions.
If you did not use the sausage, spread the olive oil around on the bottom of the skillet/dutch oven.
Begin to build your gratin by laying out a single layer of potatoes on the bottom of the skillet with ¼ of the potatoes. Top with 1/3 of the onion, then 1/3 of the sausage, then 1/3 of the cheese.
Repeat until you have three layers and then top with the remaining ¼ of the potatoes.
Pour the sauce over the top and make sure it is as evenly distributed as possible.
Bake for 35-45 minutes, or until the potatoes are done.