diff --git a/plugins/module_utils/gcp_utils.py b/plugins/module_utils/gcp_utils.py index 8bc6d92..4c50feb 100644 --- a/plugins/module_utils/gcp_utils.py +++ b/plugins/module_utils/gcp_utils.py @@ -125,8 +125,8 @@ class GcpSession(object): credentials, project_id = google.auth.default() return credentials elif cred_type == 'serviceaccount': - return service_account.Credentials.from_service_account_file( - self.module.params['service_account_file']) + path = os.path.realpath(os.path.expanduser(self.module.params['service_account_file'])) + return service_account.Credentials.from_service_account_file(path) elif cred_type == 'machineaccount': return google.auth.compute_engine.Credentials( self.module.params['service_account_email'])