mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #3925 from AlanCoding/gce_contract
Restore old use pattern for gce_ modules, update token_uri URL Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
5a502f8709
@ -19,18 +19,19 @@ def gce(cred, env, private_data_dir):
|
||||
project = cred.get_input('project', default='')
|
||||
username = cred.get_input('username', default='')
|
||||
|
||||
if 'INVENTORY_UPDATE_ID' not in env:
|
||||
env['GCE_EMAIL'] = username
|
||||
env['GCE_PROJECT'] = project
|
||||
json_cred = {
|
||||
'type': 'service_account',
|
||||
'private_key': cred.get_input('ssh_key_data', default=''),
|
||||
'client_email': username,
|
||||
'project_id': project,
|
||||
# need token uri for inventory plugins
|
||||
# should this really be hard coded? Good question.
|
||||
'token_uri': 'https://accounts.google.com/o/oauth2/token',
|
||||
'project_id': project
|
||||
}
|
||||
if 'INVENTORY_UPDATE_ID' not in env:
|
||||
env['GCE_EMAIL'] = username
|
||||
env['GCE_PROJECT'] = project
|
||||
else:
|
||||
# gcp_compute inventory plugin requires token_uri
|
||||
# although it probably should not, since gce_modules do not
|
||||
json_cred['token_uri'] = 'https://oauth2.googleapis.com/token'
|
||||
|
||||
handle, path = tempfile.mkstemp(dir=private_data_dir)
|
||||
f = os.fdopen(handle, 'w')
|
||||
|
@ -3,5 +3,5 @@
|
||||
"private_key": "{{private_key}}",
|
||||
"client_email": "fooo",
|
||||
"project_id": "fooo",
|
||||
"token_uri": "https://accounts.google.com/o/oauth2/token"
|
||||
"token_uri": "https://oauth2.googleapis.com/token"
|
||||
}
|
@ -3,5 +3,5 @@
|
||||
"private_key": "{{private_key}}",
|
||||
"client_email": "fooo",
|
||||
"project_id": "fooo",
|
||||
"token_uri": "https://accounts.google.com/o/oauth2/token"
|
||||
"token_uri": "https://oauth2.googleapis.com/token"
|
||||
}
|
Loading…
Reference in New Issue
Block a user