Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
donovan-prehn opened this issue Nov 24, 2023 · 2 comments · May be fixed by #222
Open

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

donovan-prehn opened this issue Nov 24, 2023 · 2 comments · May be fixed by #222
Labels
bug Something isn't working gce

Comments

@donovan-prehn
Copy link

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
Copy link
Author

donovan-prehn commented Nov 24, 2023

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

  • molecule_yml.driver.auth_kind == 'application'
    or
  • both molecule_yml.driver.service_account_file/GCP_SERVICE_ACCOUNT_FILE is empty, since they shouldn't be allowed to be set when using auth_kind: application.

@zhan9san
Copy link
Member

zhan9san commented Dec 2, 2023

@donovan-prehn

Would you mind submitting a PR to fix this issue?

@zhan9san zhan9san added bug Something isn't working gce labels Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gce
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants