ansible-community / molecule-plugins

Collection on molecule plugins
MIT License
101 stars 67 forks source link

GCE plugin fails when creating windows hosts if using application default auth #212

Open donovan-prehn opened 7 months ago

donovan-prehn commented 7 months ago

The 'Prepare Windows User' will set the env variable GOOGLE_APPLICATION_CREDENTIALS to an empty string when the molecule_yml.driver.service_account_file/GCP_SERVICE_ACCOUNT_FILE is undefined (which it commonly is when using auth_kind: application). windows_auth.py then fails to find the application credentials json file since GOOGLE_APPLICATION_CREDENTIALS is ""

https://github.com/ansible-community/molecule-plugins/blob/196ed1eb034ebf343a270102179c98e84f49eb71/src/molecule_plugins/gce/playbooks/tasks/create_windows_instance.yml#L64C44-L64C44

donovan-prehn commented 7 months ago

I think this could be resolved by either not setting GOOGLE_APPLICATION_CREDENTIALS if

zhan9san commented 7 months ago

@donovan-prehn

Would you mind submitting a PR to fix this issue?