aiyor / aiyor.gcp / 1.0.1 / lookup / gcp_accesstoken Authors: unknownaiyor.gcp.gcp_accesstoken (1.0.1) — lookup
Install with ansible-galaxy collection install aiyor.gcp:==1.0.1
collections: - name: aiyor.gcp version: 1.0.1
This lookup returns the GCP OAuth2 access token from either service account key, service account via workload identity federation, or service account attached to Google VM.
- ansible.builtin.debug: # Using service account json authentication file msg: | the google access token is {{ lookup( 'gcp_accesstoken', auth_kind='serviceaccount', service_account_file='/tmp/myserviceaccountfile.json') }}
auth_kind: choices: - application - machineaccount - serviceaccount default: environment variable 'GCP_AUTH_KIND' description: - The type of credential used. required: true type: str service_account_file: description: - The path of a Service Account JSON file if serviceaccount is selected as type. type: path service_account_email: description: - An optional service account email address if machineaccount is selected and the user does not wish to use the default email. type: str service_account_contents: description: - The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. type: jsonarg
_raw: description: - OAuth2 access token string