Test packages install status before installing them

Prevent puppet from crashing when the required packages were already installed by another way or module.