| This occurs because when foo2 is added to the catalog, puppet adds a resource reference based on the title foo1 and its aliases (based on its namevars, in this case foo2):
(byebug) catalog.resource_refs.grep /Cron/ |
["Cron[foo1]", "Cron[foo2]"]
|
Since the crontab contains entries for foo1 and foo2, nothing is purged. However, if you had foo3 in the crontab, it would be purged. For this issue, I don't think it's fair to say puppet fails to purge the resource when the title != name. Instead, puppet can't purge the resource if there is an existing entry whose namevar(s) match the title of a resource we are managing. This is related to PUP-10108, though it's slightly different. In this case, I don't think we should check if the resource (as obtained from the system) matches the title of a resource in the catalog. Instead we should only compare based on the resources' uniqueness key. But I'd need to research more to be sure that's safe. |