Fix "Folder not created when running only redis"
Changes the order where the directory permissions/creation is done for the ssh_keygen
resource.
Added a few checks to prevent running when user
or group
doesn't exist.
Added a few specs to improve coverage
Closes #1844 (closed)