Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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