Skip to content

Commit

Permalink
fixed calling windows_auth.py for application auth
Browse files Browse the repository at this point in the history
  • Loading branch information
donovan-prehn committed Dec 17, 2023
1 parent fe3ceb6 commit 03f09cc
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
delay: 10
loop: "{{ server.results }}"

- name: Set env vars for auth script
ansible.builtin.set_fact:
script_env_vars:
GOOGLE_APPLICATION_CREDENTIALS: "{{ service_account_file }}"
vars:
auth_kind: "{{ molecule_yml.driver.auth_kind | default(lookup('env', 'GCP_AUTH_KIND')) }}"
service_account_file: "{{ molecule_yml.driver.service_account_file | default(lookup('env', 'GCP_SERVICE_ACCOUNT_FILE'), true) }}"
when: auth_kind == 'serviceaccount'

- name: Prepare Windows User
ansible.builtin.script: >
./files/windows_auth.py
Expand All @@ -60,8 +69,7 @@
--username molecule_usr
args:
executable: python3
environment:
GOOGLE_APPLICATION_CREDENTIALS: "{{ molecule_yml.driver.service_account_file | default(lookup('env', 'GCP_SERVICE_ACCOUNT_FILE'), true) }}"
environment: "{{ script_env_vars | default({}) }}"
loop: "{{ molecule_yml.platforms }}"
changed_when:
- password.rc == 0
Expand Down

0 comments on commit 03f09cc

Please sign in to comment.