Step 1 Heat the broiler.
Step 2 Peel and core the pineapple, cutting it into slices one-half-inch thick. Place the pineapple slices onto a foil-lined baking sheet.
Step 3In a small bowl or measuring cup, stir together one-fourth cup rum with one-fourth cup sugar. Brush the rum and sugar mixture over the sliced pineapple.
Step 4Place the pineapple under the broiler and broil until the pineapple is a rich golden-brown in places and the sugar is caramelized, 6 to 10 minutes, depending on the moisture in the pineapple and heat of the broiler.
Step 5Remove from heat and set the baking sheet with the pineapple aside to cool, then cut the slices into one-half-inch chunks.
Step 6While the pineapple is cooling, combine the remaining rum, sugar, water, long peppers, cinnamon and star anise in a large saucepan. Bring the mixture to a boil over high heat, stirring occasionally.
Step 7Add the pineapple chunks to the mixture, reduce the heat to a simmer, and continue to cook until the pineapple is tender and the flavors are married, 10 to 15 minutes. Remove from heat and stir in the vanilla seeds and pod.
Step 8Place the mixture in a glass jar or bowl and set aside until cool. Cover tightly and refrigerate until needed. The confit will keep for up to two weeks, covered and refrigerated.